protected void rptProjectsDetail_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            switch (e.CommandName)
            {
            case "Delete":
            {
                List <ENTPRJPROJECTTASKRESOURSE> ProjectTaskResourseList = DALProjectTaskResourse.GetAllListTaskResoursesID(Guid.Parse(e.CommandArgument.ToString()));


                foreach (ENTPRJPROJECTTASKRESOURSE rsr in ProjectTaskResourseList)
                {
                    List <ENTPRJPROJECTTASKRESOURSEACTIVITY> ProjectTaskResourseActivityList = DALProjectTaskResourseActivity.GetAllListTaskResoursesActivityID(rsr.ID);
                    foreach (ENTPRJPROJECTTASKRESOURSEACTIVITY act in ProjectTaskResourseActivityList)
                    {
                        DALProjectTaskResourseActivity.Delete(act.ID);
                    }
                    DALProjectTaskResourse.Delete(rsr.ID);
                }


                DALProjectTask.Delete(Guid.Parse(e.CommandArgument.ToString()));
                FillProjectTasks();
                break;
            }
            }
        }
Beispiel #2
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);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                drpFullName.Enabled = false;
                DrpFullNameFill();
                DrpProjectTaskResourseStatusFill();


                if (!string.IsNullOrEmpty(Request.QueryString["ID"]))//alanları doldurdum.
                {
                    ENTVWPRJPROJECTTASKRESOURCE ptsk = DALProjectTaskResourse.GetValueTaskResourse(Guid.Parse(Request.QueryString["ID"]));


                    if (ptsk != null)
                    {
                        PROJECTID                   = ptsk.ID;
                        PROJECTTASKID               = ptsk.PROJECTTASKID;
                        lblProjectTaskName.Text     = ptsk.PROJECTTASKNAME;
                        txtHour.Text                = ptsk.DURATION.ToString();
                        drpFullName.SelectedValue   = ptsk.USERID.ToString();
                        drpIsComplete.SelectedValue = ptsk.TYPEPROJECTRESOURSESTATUSID.ToString();
                    }
                    else
                    {
                        Response.Redirect("/Prj/PRJProjectTaskResourseDetail.aspx?ID=" + PROJECTTASKID);
                    }
                }
                else
                {
                    Response.Redirect("/Prj/PRJProjects.aspx");
                }
            }
        }
        protected void rptFirms_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            switch (e.CommandName)
            {
            case "Delete":

                List <ENTMEMUSER> FirmUserList = DALUser.GetAllListUserID(Guid.Parse(e.CommandArgument.ToString()));

                foreach (ENTMEMUSER user in FirmUserList)
                {
                    List <ENTREQREQUESTS> FirmRequestList = DALRequest.GetAllListFirmRequestsID(user.ID);

                    foreach (ENTREQREQUESTS rqst in FirmRequestList)
                    {
                        List <ENTREQREQUESTDETAIL> FirmRequestDetailList = DALRequest.GetAllListRequestDetailsID(rqst.ID);

                        foreach (ENTREQREQUESTDETAIL rqstdtl in FirmRequestDetailList)
                        {
                            DALRequest.DeleteDetail(rqstdtl.ID);
                        }
                        DALRequest.Delete(rqst.ID);
                    }

                    List <ENTPRJPROJECTTASKRESOURSE> ProjectTaskResourseList = DALProjectTaskResourse.GetAllListFirmResoursesID(user.ID);


                    foreach (ENTPRJPROJECTTASKRESOURSE rsr in ProjectTaskResourseList)
                    {
                        List <ENTPRJPROJECTTASKRESOURSEACTIVITY> ProjectTaskResourseActivityList = DALProjectTaskResourseActivity.GetAllListTaskResoursesActivityID(rsr.ID);

                        foreach (ENTPRJPROJECTTASKRESOURSEACTIVITY act in ProjectTaskResourseActivityList)
                        {
                            DALProjectTaskResourseActivity.Delete(act.ID);
                        }
                        DALProjectTaskResourse.Delete(rsr.ID);
                    }
                    DALUser.Delete(user.ID);
                }

                List <ENTPRJPROJECT> FirmProjectList = DALProject.GetAllListTaskID(Guid.Parse(e.CommandArgument.ToString()));

                foreach (ENTPRJPROJECT prj in FirmProjectList)
                {
                    List <ENTPRJPROJECTTASK> ProjectTaskList = DALProjectTask.GetAllListTaskID(prj.ID);

                    foreach (ENTPRJPROJECTTASK tsk in ProjectTaskList)
                    {
                        DALProjectTask.Delete(tsk.ID);
                    }
                    DALProject.Delete(prj.ID);
                }

                DALFirm.Delete(Guid.Parse(e.CommandArgument.ToString()));

                FillFirm();
                break;
            }
        }
        public void DrpProjectTaskResourseStatusFill()
        {
            List <ENTPRJTYPEPROJECTTASKRESOURSESTATUS> list = DALProjectTaskResourse.GetAllProjectTaskResourseStatus();

            drpIsComplete.Items.Clear();
            drpIsComplete.DataSource     = list;
            drpIsComplete.DataValueField = "ID";
            drpIsComplete.DataTextField  = "NAME";
            drpIsComplete.DataBind();
            drpIsComplete.Items.Insert(0, new ListItem("Seçiniz", "0"));
        }
        private void FillProjectTaskResourse()
        {
            ENTVWPRJPROJECTTASK prjtsk = DALProjectTask.GetValueTask(Guid.Parse(Request.QueryString["ID"]));

            if (prjtsk != null)
            {
                PROJECTTASKID = prjtsk.ID;
                rptProjectTaskResourceDetail.DataSource = DALProjectTaskResourse.GetAllListProjectsTaskResourse(PROJECTTASKID);
                rptProjectTaskResourceDetail.DataBind();
            }
            else
            {
                Response.Redirect("/Prj/PRJProjectDetail.aspx?ID=" + PROJECTTASKID);
            }
        }
 protected void btnUpdate_Click(object sender, EventArgs e)
 {
     if (ValidateRecord()) // 1) Valideta controle git hata kontrolu yapılsın. hata yok ise if içine girer.
     {
         ENTPRJPROJECTTASKRESOURSE ptskrsrs = DALProjectTaskResourse.GetValueTaskResourseNotVW(Guid.Parse(Request.QueryString["ID"]));
         if (ptskrsrs != null)
         {
             PROJECTTASKID   = ptskrsrs.PROJECTTASKID;//Project detaila dönmek icin projectıd degerini aldık.
             ptskrsrs.USERID = Guid.Parse(drpFullName.SelectedValue.ToString());
             ptskrsrs.TYPEPROJECTRESOURSESTATUSID = Convert.ToByte(drpIsComplete.SelectedValue.ToString());
             ptskrsrs.DURATION = Convert.ToByte(txtHour.Text);
             DALProjectTaskResourse.Update(ptskrsrs);
             Response.Redirect("/Prj/PRJProjectTaskResourseDetail.aspx?ID=" + PROJECTTASKID);
         }
     }
 }
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            if (ValidateRecord() && ValidateControlUser())
            {
                ENTPRJPROJECTTASKRESOURSE ptskrsrs = new ENTPRJPROJECTTASKRESOURSE();
                ptskrsrs.ID            = Guid.NewGuid();
                ptskrsrs.PROJECTTASKID = PROJECTTASKID;
                ptskrsrs.USERID        = Guid.Parse(drpFullName.SelectedValue);
                ptskrsrs.DURATION      = Convert.ToByte(txtHour.Text);
                ptskrsrs.TYPEPROJECTRESOURSESTATUSID = Convert.ToByte(drpIsComplete.SelectedValue);
                //ptskrsrs.ISCOMPLETE = false;

                DALProjectTaskResourse.InsertTable(ptskrsrs); //bu fonksiyona gider atama yapılmıs degerlerı tabloya dataya kayıt eder
                Response.Redirect("/Prj/PRJProjectTaskResourseDetail.aspx?ID=" + PROJECTTASKID);
            }
        }
        private bool ValidateControlUser()
        {
            bool cntrl = true;

            USERID = Guid.Parse(drpFullName.SelectedValue);
            cntrl  = DALProjectTaskResourse.ControltoUSER(PROJECTTASKID, USERID);
            if (cntrl)
            {
                cntrl = false;
                AddMessage(lblError1, "Bu göreve bu çalışan eklenmiştir.", false);
            }
            else
            {
                cntrl = true;
                return(cntrl);
            }
            return(cntrl);
        }