Ejemplo n.º 1
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            ENTPRJPROJECTTASKRESOURSE rsrs = DALProjectTaskResourse.GetValueComplete(PROJECTTASKID, ONLINEUSER.ID);
            if (rsrs.TYPEPROJECTRESOURSESTATUSID == 1 || rsrs.TYPEPROJECTRESOURSESTATUSID == 2)
            {
                if (ValidateRecord())
                {
                    ENTPRJPROJECTTASKRESOURSEACTIVITY activity = new ENTPRJPROJECTTASKRESOURSEACTIVITY();
                    activity.ID = Guid.NewGuid();
                    activity.PROJECTTASKRESOURSEID = Guid.Parse(Request.QueryString["ID"]);
                    activity.DATE = Convert.ToDateTime(txtDate.Text);
                    activity.DESCRIPTION = txtDescription.Text;
                    if (!string.IsNullOrEmpty(txtDuration.Text))
                    {
                        activity.RESOURSEDURATION = Convert.ToByte(txtDuration.Text);
                    }
                    else
                    {
                        activity.RESOURSEDURATION = null;
                    }
                    DALProjectTaskResourseActivity.InsertTable(activity);

                    Response.Redirect("/Prj/PRJMyActivity.aspx?ID=" + PROJECTASKRESOURSEID);
                }
            }
            else
            {
                AddMessage(lblError1, "Bu aktivite tamamlanmıştır.!", false);
            }
        }
Ejemplo n.º 2
0
 protected void btnUpdate_Click(object sender, EventArgs e)
 {
     if (ValidateRecord())
     {
         ENTPRJPROJECTTASKRESOURSEACTIVITY activity = DALProjectTaskResourseActivity.GetValueTaskResourseActivityForUpdate(Guid.Parse(Request.QueryString["ID"]));
         if (activity != null)
         {
             activity.ID = Guid.Parse(Request.QueryString["ID"]);
             if (!string.IsNullOrEmpty(txtDuration.Text))
             {
                 activity.RESOURSEDURATION = Convert.ToByte(txtDuration.Text);
             }
             else
             {
                 activity.RESOURSEDURATION = null;
             }
             activity.DESCRIPTION = txtDescription.Text;
             activity.DATE        = DateTime.Parse(txtDate.Text);
             DALProjectTaskResourseActivity.UpdateActivity(activity);
             Response.Redirect("/Prj/PRJMyActivity.aspx?ID=" + PROJECTTASKRESOURSEID);
         }
     }
 }