当前位置: 首页>>代码示例>>C#>>正文


C# Logic.GetTaskID方法代码示例

本文整理汇总了C#中Logic.GetTaskID方法的典型用法代码示例。如果您正苦于以下问题:C# Logic.GetTaskID方法的具体用法?C# Logic.GetTaskID怎么用?C# Logic.GetTaskID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Logic的用法示例。


在下文中一共展示了Logic.GetTaskID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: btnUpdate_Click

    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        try
        {
            Logic lo = new Logic();
            Taskk t = new Taskk();
            t.Title = txtTitle.Text;
            t.Description = txtDescription.Text;
            t.IsComplete = true;
            int taskid=lo.GetTaskID(drpTitles.SelectedItem.Text);

            if (lo.UpdateTask(t, taskid))
            {
                Label lb = new Label();
                lb.Text = "Task Updated Successfully";
                Panel1.CssClass = "divSuccess";
                icon.CssClass = "img";
                icon.ImageUrl = "~/assets/icons/success3.png";
                icon.Visible = true;
                PlaceHolder1.Controls.Add(lb);
            }
            else if (lo.UpdateTask(t, taskid))
            {
                Label lb = new Label();
                lb.Text = "Task Update Failed";
                Panel1.CssClass = "divError";
                icon.CssClass = "img";
                icon.ImageUrl = "~/assets/icons/error3.png";
                icon.Visible = true;
                PlaceHolder1.Controls.Add(lb);
            }
        }
        catch
        {
            Label lb = new Label();
            lb.Text = "Update Failed. Please Try Again";
            Panel1.CssClass = "divError";
            icon.CssClass = "img";
            icon.ImageUrl = "~/assets/icons/error3.png";
            icon.Visible = true;
            PlaceHolder1.Controls.Add(lb);
        }
    }
开发者ID:imostom,项目名称:TaskManager,代码行数:43,代码来源:UpdateTask.aspx.cs

示例2: btnDelete_Click

 protected void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         Panel1.Visible = true;
         Logic lo = new Logic();
         Taskk t = lo.GetSingleTask(drpTitles.SelectedItem.Text);
         int id = lo.GetTaskID(drpTitles.SelectedItem.Text);
         string u = Session["username"].ToString();
         Person pp = lo.GetPerson(u);
         bool delPersonTask = lo.DeletePersonTask(pp.Id, id);
         bool delTask = lo.DeleteTask(id);
         if (delPersonTask == true && delTask == true)
         {
             Label lb = new Label();
             lb.Text = "Task Deleted Successfully...";
             Panel1.CssClass = "divSuccess";
             icon.CssClass = "img";
             icon.ImageUrl = "~/assets/icons/success3.png";
             icon.Visible = true;
             PlaceHolder1.Controls.Add(lb);
             Load();
             txtTitle.Text = "";
             txtDescription.Text = "";
             txtIsCompleted.Text = "";
         }
         else
         {
             Label lb = new Label();
             lb.Text = "Delete Failed";
             Panel1.CssClass = "divError";
             icon.CssClass = "img";
             icon.ImageUrl = "~/assets/icons/error3.png";
             icon.Visible = true;
             PlaceHolder1.Controls.Add(lb);
             Load();
         }
     }
     catch
     {
     }
 }
开发者ID:imostom,项目名称:TaskManager,代码行数:42,代码来源:DeleteTask.aspx.cs

示例3: btnLoad_Click

    protected void btnLoad_Click(object sender, EventArgs e)
    {
        try
        {
            Panel1.Visible = false;

            Logic lo = new Logic();
            Taskk t = lo.GetSingleTask(drpTitles.SelectedItem.Text);
            int id = lo.GetTaskID(drpTitles.SelectedItem.Text);
            txtTitle.Text = t.Title;
            txtDescription.Text = t.Description;
            txtIsCompleted.Text = t.IsComplete.ToString();
            txtDate.Text = t.DateCreated.ToShortDateString();
        }
        catch
        {
            Label lb = new Label();
            lb.Text = "Loading Failed. Please Try Again";
            Panel1.CssClass = "divError";
            icon.CssClass = "img";
            icon.ImageUrl = "~/assets/icons/error3.png";
            icon.Visible = true;
            PlaceHolder1.Controls.Add(lb);
        }
    }
开发者ID:imostom,项目名称:TaskManager,代码行数:25,代码来源:DeleteTask.aspx.cs


注:本文中的Logic.GetTaskID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。