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


C# Logic.CreateTask方法代码示例

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


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

示例1: btnSubmit_Click

    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        Logic lo = new Logic();
        Taskk t = new Taskk();
        t.Title = tasktitle.Value;
        t.Description = taskdesc.Value;
        t.IsComplete = false;

        //DateTime.Parse(Calendar1.SelectedDate)
        if (tasktitle.Value.Length == 0 || taskdesc.Value.Length == 0)
        {
            Label lb = new Label();
            lb.Text = "Empty Fields Are Not Allowed";
            Panel1.CssClass = "divError";
            icon.CssClass = "img";
            icon.ImageUrl = "~/assets/icons/error3.png";
            icon.Visible = true;
            PlaceHolder1.Controls.Add(lb);
        }
        else if (tasktitle.Value.Length != 0 && taskdesc.Value.Length != 0)
        {
            if (Calendar1.SelectedDate != null)
            {
                t.DateCreated = (DateTime)Calendar1.SelectedDate;
                bool resp1 = lo.CreateTask(t);
                int last = lo.GetLastTaskID();
                PersonTask pt = new PersonTask();
                string u = Session["username"].ToString();
                Person pp = lo.GetPerson(u);
                pt.PersonId = pp.Id; //lo.GetPersonID("ay");
                pt.TaskkId = last;
                bool resp2 = lo.CreatePersonTask(pt);
                if (resp1 == true && resp2 == true)
                {
                    Label lb = new Label();
                    lb.Text = "New Task Added Successfully";
                    Panel1.CssClass = "divSuccess";
                    icon.CssClass = "img";
                    icon.ImageUrl = "~/assets/icons/success3.png";
                    icon.Visible = true;
                    PlaceHolder1.Controls.Add(lb);
                }
                else if (resp1 != true || resp2 != true)
                {
                    Label lb = new Label();
                    lb.Text = "New Task Could Not Be Added";
                    Panel1.CssClass = "divError";
                    icon.CssClass = "img";
                    icon.ImageUrl = "~/assets/icons/error3.png";
                    icon.Visible = true;
                    PlaceHolder1.Controls.Add(lb);
                }
            }
            else if (Calendar1.SelectedDate == null)
            {

                Label lb = new Label();
                lb.Text = "No Date Selected";
                Panel1.CssClass = "divError";
                icon.CssClass = "img";
                icon.ImageUrl = "~/assets/icons/error3.png";
                icon.Visible = true;
                PlaceHolder1.Controls.Add(lb);
            }
        }
    }
开发者ID:imostom,项目名称:TaskManager,代码行数:66,代码来源:NewTask.aspx.cs


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