protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (!string.IsNullOrEmpty(Request.QueryString["ID"]))
                {
                    FIRMID = Guid.Parse(Request.QueryString["ID"]);
                    ENTFRMFIRM frm = DALFirm.GetFirm(FIRMID);
                    if (frm != null)
                    {
                        lblFirm.Text = frm.NAME;
                    }
                    else
                    {
                        Response.Redirect("/Mng/MNGFirmDetail.aspx?ID=" + FIRMID);
                    }
                }
                else
                {
                    Response.Redirect("/Mng/MNGFirmDetail.aspx?ID=" + FIRMID);
                }

                //DrpFirmFill();
                DrpTypeUser();
                DrpLanguage();
                CalDate.Visible = false;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                DrpCityFill();
                Guid.Parse(ONLINEUSER.ID.ToString());
                if (drpCity.SelectedValue != "0")
                {
                    DrpDistrictFill();
                }


                if (!string.IsNullOrEmpty(Request.QueryString["ID"]))
                {
                    ENTFRMFIRM firm = DALFirm.GetFirm(Guid.Parse(Request.QueryString["ID"]));
                    if (firm != null)
                    {
                        FIRMID                    = firm.ID;
                        txtFirmName.Text          = firm.NAME;
                        txtDescription.Text       = firm.DESCRIPTION;
                        txtAddress.Text           = firm.ADDRESS;
                        drpCity.SelectedValue     = firm.CITYID.ToString();
                        drpDistrict.SelectedValue = firm.DISTRICTID.ToString();
                    }
                    else
                    {
                        Response.Redirect("/Mng/MNGFirmDetail.aspx?ID=" + FIRMID);
                    }
                }
                else
                {
                    Response.Redirect("/Mng/MNGFirms.aspx");
                }
            }
        }
Exemple #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         FillUser();
         if (!string.IsNullOrEmpty(Request.QueryString["ID"]))
         {
             ENTVWFRMFIRM frm = DALFirm.GetFirmInfo(Guid.Parse(Request.QueryString["ID"]));
             if (frm != null)
             {
                 FIRMID              = frm.ID;
                 lblFirmName.Text    = frm.NAME;
                 lblCity.Text        = frm.FIRMCITYNAME;
                 lblDistrict.Text    = frm.FIRMDISTRICTNAME;
                 lblAddress.Text     = frm.ADDRESS;
                 lblDescription.Text = frm.DESCRIPTION;
             }
             else
             {
                 Response.Redirect("/Mng/MNGFirms.aspx");
             }
         }
         else
         {
             Response.Redirect("/Mng/MNGFirms.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;
            }
        }
Exemple #5
0
        public void DrpFirmFill()
        {
            List <ENTVWFRMFIRM> list = DALFirm.GetAllListFirms();

            drpFirm.Items.Clear();
            drpFirm.DataSource     = list;
            drpFirm.DataValueField = "ID";
            drpFirm.DataTextField  = "NAME";
            drpFirm.Items.Insert(0, new ListItem("Seçiniz", "0"));
            drpFirm.DataBind();
        }
Exemple #6
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            if (ValidateRecord())
            {
                ENTFRMFIRM firm = new ENTFRMFIRM();
                firm.ID          = Guid.NewGuid();
                firm.NAME        = txtFirmName.Text;
                firm.DESCRIPTION = txtDescription.Text;
                firm.CITYID      = Convert.ToByte(drpCity.SelectedValue);
                firm.DISTRICTID  = Convert.ToInt16(drpCity.SelectedValue);
                firm.ADDRESS     = txtAddress.Text;

                DALFirm.InsertTable(firm);
                Response.Redirect("/Mng/MNGFirms.aspx");
            }
        }
 protected void btnUpdate_Click(object sender, EventArgs e)
 {
     if (ValidateRecord())
     {
         ENTFRMFIRM firm = DALFirm.GetFirm(Guid.Parse(Request.QueryString["ID"]));
         if (firm != null)
         {
             firm.NAME        = txtFirmName.Text;
             firm.DESCRIPTION = txtDescription.Text;
             firm.ADDRESS     = txtAddress.Text;
             firm.CITYID      = Convert.ToByte(drpCity.SelectedValue);
             firm.DISTRICTID  = Convert.ToInt16(drpDistrict.SelectedValue);
             DALFirm.Update(firm);
             Response.Redirect("/Mng/MNGFirmDetail.aspx?ID=" + FIRMID);
         }
     }
 }
 private void FillFirm()
 {
     rptFirms.DataSource = DALFirm.GetAllListFirms();
     rptFirms.DataBind();
 }