示例#1
0
        private void SetBranchForEdit(string productId, string campaignId, string staffTypeId)
        {
            try
            {
                var list = SystemAssignBiz.SearchSystemAssignConfig(productId, campaignId, staffTypeId, "");
                List <ControlListData> selectedList = list.Select(p => new ControlListData {
                    TextField = p.BranchName, ValueField = p.BranchCode
                }).OrderBy(p => p.TextField).ToList();
                BindListBox(lboxBranchSelected, selectedList);

                List <ControlListData> allBranchList = BranchBiz.GetBranchListByRole(SLMConstant.Branch.All, staffTypeId);
                foreach (ControlListData data in selectedList)
                {
                    ControlListData obj = allBranchList.Where(p => p.ValueField == data.ValueField).FirstOrDefault();
                    if (obj != null)
                    {
                        allBranchList.Remove(obj);
                    }
                }

                BindListBox(lboxBranchAll, allBranchList);

                lblBranchAllTotal.Text      = lboxBranchAll.Items.Count.ToString();
                lblBranchSelectedTotal.Text = lboxBranchSelected.Items.Count.ToString();
            }
            catch
            {
                throw;
            }
        }
示例#2
0
 private void DoSearchSystemAssign(int pageIndex)
 {
     try
     {
         List <SystemAssignData> list = SystemAssignBiz.SearchSystemAssignConfig(cmbProductSearch.SelectedItem.Value, cmbCampaignSearch.SelectedItem.Value, cmbStaffTypeSearch.SelectedItem.Value, cmbBranchSearch.SelectedItem.Value);
         BindGridview(pcTop, list.ToArray(), pageIndex);
     }
     catch
     {
         throw;
     }
 }
示例#3
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (ValidateInput())
                {
                    int staffTypeId = Convert.ToInt32(cmbStaffTypePopup.SelectedItem.Value);

                    if (cbEdit.Checked)
                    {
                        SystemAssignBiz.UpdateData(cmbProductPopup.SelectedItem.Value, cmbCampaignPopup.SelectedItem.Value, staffTypeId, GetSelectedBranchCode(), HttpContext.Current.User.Identity.Name);
                    }
                    else
                    {
                        SystemAssignBiz.InsertData(cmbProductPopup.SelectedItem.Value, cmbCampaignPopup.SelectedItem.Value, staffTypeId, GetSelectedBranchCode(), HttpContext.Current.User.Identity.Name);
                    }

                    AppUtil.ClientAlert(Page, "บันทึกข้อมูลเรียบร้อย");

                    ClearPopupControl();
                    upPopup.Update();
                    mpePopup.Hide();

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