Example #1
0
        private void InitialControl()
        {
            AppUtil.SetIntTextBox(txtSlaMinPopup);
            AppUtil.SetIntTextBox(txtSlaTimePopup);
            AppUtil.SetIntTextBox(txtSlaDayPopup);

            txtSlaMinPopup.Attributes.Add("OnBlur", "ChkIntOnBlurClear(this)");
            txtSlaTimePopup.Attributes.Add("OnBlur", "ChkIntOnBlurClear(this)");
            txtSlaDayPopup.Attributes.Add("OnBlur", "ChkIntOnBlurClear(this)");

            //Search
//            cmbProductSearch.DataSource = ProductBiz.GetProductList();
            cmbProductSearch.DataSource     = ProductBiz.GetProductListNew();
            cmbProductSearch.DataTextField  = "TextField";
            cmbProductSearch.DataValueField = "ValueField";
            cmbProductSearch.DataBind();
            cmbProductSearch.Items.Insert(0, new ListItem("", ""));
            cmbProductSearch.Items.Insert(1, new ListItem("DEFAULT", "DEFAULT"));

            //cmbCampaignSearch.DataSource = CampaignBiz.GetCampaignList("");
            cmbCampaignSearch.DataSource     = CampaignBiz.GetCampaignListNew("");
            cmbCampaignSearch.DataTextField  = "TextField";
            cmbCampaignSearch.DataValueField = "ValueField";
            cmbCampaignSearch.DataBind();
            cmbCampaignSearch.Items.Insert(0, new ListItem("", ""));
            cmbCampaignSearch.Items.Insert(1, new ListItem("DEFAULT", "DEFAULT"));

            cmbChannelSearch.DataSource     = ChannelBiz.GetChannelList();
            cmbChannelSearch.DataTextField  = "TextField";
            cmbChannelSearch.DataValueField = "ValueField";
            cmbChannelSearch.DataBind();
            cmbChannelSearch.Items.Insert(0, new ListItem("", ""));

            cmbStatusSearch.DataSource     = OptionBiz.GetOptionList(AppConstant.OptionType.LeadStatus);
            cmbStatusSearch.DataTextField  = "TextField";
            cmbStatusSearch.DataValueField = "ValueField";
            cmbStatusSearch.DataBind();
            cmbStatusSearch.Items.Insert(0, new ListItem("", ""));

            //Popup
            BindPopupProductCampaignCombo("load");

            cmbChannelPopup.DataSource     = ChannelBiz.GetChannelList();
            cmbChannelPopup.DataTextField  = "TextField";
            cmbChannelPopup.DataValueField = "ValueField";
            cmbChannelPopup.DataBind();
            cmbChannelPopup.Items.Insert(0, new ListItem("", ""));

            cmbStatusPopup.DataSource     = OptionBiz.GetOptionList(AppConstant.OptionType.LeadStatus);
            cmbStatusPopup.DataTextField  = "TextField";
            cmbStatusPopup.DataValueField = "ValueField";
            cmbStatusPopup.DataBind();
            cmbStatusPopup.Items.Insert(0, new ListItem("", ""));
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                vcmbBranchCode.Text     = "";
                vcmbHeadBranchCode.Text = "";
                string desc;
                if (cmbBranchCode.SelectedItem.Value != txtOldBranchCode.Text.Trim())
                {
                    if (SlmScr018Biz.CheckExistLeadOnHand(txtUsername.Text.Trim()))
                    {
                        AppUtil.ClientAlert(Page, "ไม่สามารถเปลี่ยนข้อมูลสาขาได้ เนื่องจากยังมีงานค้างอยู่");
                        return;
                    }
                }
                else if (txtOldIsDeleted.Text.Trim() != txtNewIsDeleted.Text.Trim())
                {
                    if (SlmScr018Biz.CheckExistLeadOnHand(txtUsername.Text.Trim()))
                    {
                        AppUtil.ClientAlert(Page, "ไม่สามารถเปลี่ยนสถานะพนักงานได้ เนื่องจากยังมีงานค้างอยู่");
                        return;
                    }
                    if (ChannelBiz.CheckUserErrorInUse(txtUsername.Text.Trim()))
                    {
                        AppUtil.ClientAlert(Page, "ไม่สามารถเปลี่ยนสถานะพนักงานได้ เนื่องจากพนักงานนี้ถูกกำหนดเป็นผู้รับผิดชอบ Channel (Table: kkslm_ms_channel) กรุณาแจ้ง IT เพื่อทำการเซ็ทค่าออก");
                        return;
                    }
                }
                else if (ChannelBiz.CheckHeadStaff(txtStaffId.Text, cmbHeadStaffId.SelectedValue.Trim(), out desc))
                {
                    AppUtil.ClientAlert(Page, "ไม่สามารถเปลี่ยนหัวหน้างานได้เนื่องจาก " + txtStaffNameTH.Text + "เป็นหัวหน้างาน" + cmbHeadStaffId.Text.Trim());
                    return;
                }
                //else if (ChannelBiz.CheckUnderStaff(txtStaffId.Text, cmbHeadStaffId.SelectedValue.Trim(), out desc))
                //{
                //    AppUtil.ClientAlert(Page, "ไม่สามารถเปลี่ยนหัวหน้างานได้เนื่องจากหัวหน้างานเป็นผู้ใต้บังคับัญชา");
                //        return;
                //}

                SaveData();
            }
            catch (Exception ex)
            {
                string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                _log.Debug(message);
                AppUtil.ClientAlert(Page, message);
            }
        }
Example #3
0
        private void InitialControl()
        {
            AppUtil.SetIntTextBox(txtWorkStartHourPopup);
            AppUtil.SetIntTextBox(txtWorkStartMinPopup);
            AppUtil.SetIntTextBox(txtWorkEndHourPopup);
            AppUtil.SetIntTextBox(txtWorkEndMinPopup);
            AppUtil.SetTimeControlScript(txtWorkStartHourPopup, txtWorkStartMinPopup);
            AppUtil.SetTimeControlScript(txtWorkEndHourPopup, txtWorkEndMinPopup);

            //Search
            cmbChannelSearch.DataSource     = ChannelBiz.GetChannelList();
            cmbChannelSearch.DataTextField  = "TextField";
            cmbChannelSearch.DataValueField = "ValueField";
            cmbChannelSearch.DataBind();
            cmbChannelSearch.Items.Insert(0, new ListItem("", ""));

            //Popup
            cmbChannelPopup.DataSource     = ChannelBiz.GetChannelList();
            cmbChannelPopup.DataTextField  = "TextField";
            cmbChannelPopup.DataValueField = "ValueField";
            cmbChannelPopup.DataBind();
            cmbChannelPopup.Items.Insert(0, new ListItem("", ""));
        }
Example #4
0
        private void InitialControl()
        {
            AppUtil.SetIntTextBox(txtWorkStartHourPopup);
            AppUtil.SetIntTextBox(txtWorkStartMinPopup);
            AppUtil.SetIntTextBox(txtWorkEndHourPopup);
            AppUtil.SetIntTextBox(txtWorkEndMinPopup);
            AppUtil.SetTimeControlScript(txtWorkStartHourPopup, txtWorkStartMinPopup);
            AppUtil.SetTimeControlScript(txtWorkEndHourPopup, txtWorkEndMinPopup);

            //Search
            cmbChannelSearch.DataSource     = ChannelBiz.GetChannelList();
            cmbChannelSearch.DataTextField  = "TextField";
            cmbChannelSearch.DataValueField = "ValueField";
            cmbChannelSearch.DataBind();
            cmbChannelSearch.Items.Insert(0, new ListItem("", ""));

            //Popup
            cmbChannelPopup.DataSource     = ChannelBiz.GetChannelList();
            cmbChannelPopup.DataTextField  = "TextField";
            cmbChannelPopup.DataValueField = "ValueField";
            cmbChannelPopup.DataBind();
            cmbChannelPopup.Items.Insert(0, new ListItem("", ""));

            //UpperBranch
            cmbUpperBranchPopup.DataSource     = BranchBiz.GetBranchList(1);
            cmbUpperBranchPopup.DataTextField  = "TextField";
            cmbUpperBranchPopup.DataValueField = "ValueField";
            cmbUpperBranchPopup.DataBind();
            cmbUpperBranchPopup.Items.Insert(0, new ListItem("", ""));

            //จังหวัด
            cmbProvince.DataSource     = SlmScr010Biz.GetProvinceDataNew();
            cmbProvince.DataTextField  = "TextField";
            cmbProvince.DataValueField = "ValueField";
            cmbProvince.DataBind();
            cmbProvince.Items.Insert(0, new ListItem("", ""));
        }
Example #5
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                vcmbBranchCode.Text     = "";
                vcmbHeadBranchCode.Text = "";

                if (cmbBranchCode.SelectedItem.Value != txtOldBranchCode.Text.Trim())
                {
                    if (SlmScr018Biz.CheckExistLeadOnHand(txtUsername.Text.Trim()))
                    {
                        AppUtil.ClientAlert(Page, "ไม่สามารถเปลี่ยนข้อมูลสาขาได้ เนื่องจากยังมีงานค้างอยู่");
                        return;
                    }
                    if (SlmScr018Biz.CheckExistPreLeadOnHand(txtUsername.Text.Trim()))
                    {
                        AppUtil.ClientAlert(Page, "ไม่สามารถเปลี่ยนข้อมูลสาขาได้ เนื่องจากยังมีงานค้างอยู่");
                        return;
                    }
                    //new 2016-11-09
                    if (SlmScr018Biz.CheckExistsTeamTeleSales(txtUsername.Text.Trim()))
                    {
                        AppUtil.ClientAlert(Page, "ไม่สามารถเปลี่ยนข้อมูลสาขาได้ เนื่องจากพนักงานรายนี้ถูกกำหนดเป็นหัวหน้าทีม Telesale Outbound อยู่");
                        return;
                    }
                }
                else if (txtOldIsDeleted.Text.Trim() != txtNewIsDeleted.Text.Trim())
                {
                    if (SlmScr018Biz.CheckExistLeadOnHand(txtUsername.Text.Trim()))
                    {
                        AppUtil.ClientAlert(Page, "ไม่สามารถเปลี่ยนสถานะพนักงานได้ เนื่องจากยังมีงานค้างอยู่");
                        return;
                    }
                    if (SlmScr018Biz.CheckExistPreLeadOnHand(txtUsername.Text.Trim()))
                    {
                        AppUtil.ClientAlert(Page, "ไม่สามารถเปลี่ยนข้อมูลสาขาได้ เนื่องจากยังมีงานค้างอยู่");
                        return;
                    }
                    if (ChannelBiz.CheckUserErrorInUse(txtUsername.Text.Trim()))
                    {
                        AppUtil.ClientAlert(Page, "ไม่สามารถเปลี่ยนสถานะพนักงานได้ เนื่องจากพนักงานนี้ถูกกำหนดเป็นผู้รับผิดชอบ Channel (Table: kkslm_ms_channel) กรุณาแจ้ง IT เพื่อทำการเซ็ทค่าออก");
                        return;
                    }
                    if (ChannelBiz.CheckUserAdminProductInUse(txtEmpCode.Text.Trim()))
                    {
                        AppUtil.ClientAlert(Page, "ไม่สามารถเปลี่ยนสถานะพนักงานได้ เนื่องจากพนักงานนี้ถูกกำหนดเป็นผู้รับผิดชอบ Product (Table: kkslm_ms_config_product_admin) กรุณาแจ้ง IT เพื่อทำการเซ็ทค่าออก");
                        return;
                    }
                    //new 2016-11-09
                    if (SlmScr018Biz.CheckExistsTeamTeleSales(txtUsername.Text.Trim()))
                    {
                        AppUtil.ClientAlert(Page, "ไม่สามารถเปลี่ยนสถานะพนักงานได้ เนื่องจากพนักงานรายนี้ถูกกำหนดเป็นหัวหน้าทีม Telesale Outbound อยู่");
                        return;
                    }
                }

                SaveData();
            }
            catch (Exception ex)
            {
                string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                _log.Error(message);
                AppUtil.ClientAlert(Page, message);
            }
        }