Beispiel #1
0
        protected void btnSavePopupAddConfigCustomer_Click(object sender, EventArgs e)
        {
            try
            {
                if (ValidatePopupAddConfigCustomer())
                {
                    AssignConditionCustomerBiz biz = new AssignConditionCustomerBiz();
                    if (biz.ValidateData(cmbAddProduct_Cus.SelectedItem.Value, decimal.Parse(cmbAddCustomerGrade_Cus.SelectedItem.Value), decimal.Parse(cmbAddAssignType_Cus.SelectedItem.Value)))
                    {
                        biz.InsertData(cmbAddProduct_Cus.SelectedItem.Value, cmbAddCustomerGrade_Cus.SelectedItem.Value, cmbAddAssignType_Cus.SelectedItem.Value, HttpContext.Current.User.Identity.Name.ToLower());

                        ClearPopupAddConfigCustomer();
                        mpePopupAddConfigCustomer.Hide();

                        DoSearchConfigCustomer(0);
                        AppUtil.ClientAlert(Page, "บันทึกข้อมูลเรียบร้อย");
                    }
                    else
                    {
                        AppUtil.ClientAlert(Page, biz.ErrorMessage);
                        mpePopupAddConfigCustomer.Show();
                    }
                }
                else
                {
                    mpePopupAddConfigCustomer.Show();
                }
            }
            catch (Exception ex)
            {
                string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                _log.Error(message);
                AppUtil.ClientAlert(Page, message);
            }
        }
Beispiel #2
0
 private void DoSearchConfigCustomer(int pageIndex)
 {
     try
     {
         AssignConditionCustomerBiz biz  = new AssignConditionCustomerBiz();
         List <AssignConditionData> list = biz.SearchAssignConditionCustomer(cmbProductSearch.SelectedItem.Value, cmbGradeSearch.SelectedItem.Value, cmbAssignTypeSearch.SelectedItem.Value);
         BindGridview_AddConfigCustomer(pcTop, list.ToArray(), pageIndex);
     }
     catch
     {
         throw;
     }
 }