Esempio n. 1
0
        protected void cmdSearch_Click(object sender, EventArgs e)
        {
            lblMessage.Text = string.Empty;

            lblCIF.Text           = string.Empty;
            lblCustomerName.Text  = string.Empty;
            lblCMND.Text          = string.Empty;
            lblTelephone.Text     = string.Empty;
            lblAddress.Text       = string.Empty;
            lblAccountNumber.Text = string.Empty;
            lblAmount.Text        = string.Empty;

            if (string.IsNullOrEmpty(txtCIF.Text))
            {
                lblMessage.Text = "Nhập mã khách hàng";
                txtCIF.Focus();
                return;
            }

            if (string.IsNullOrEmpty(cboBranch.SelectedItem.Value))
            {
                lblMessage.Text = "Chọn chi nhánh";
                cboBranch.Focus();
                return;
            }
            bool bValidate = false;

            //using (eCS.IeCSAdminClient client = new eCS.IeCSAdminClient())
            //{
            //    bool result = true;
            //    string response = string.Empty;
            //    eCS.EBankingCustomerInformation objEBankingCustomerInformation = client.GetCustomerInformation(txtCIF.Text, ref result, ref response);
            //    if (result && objEBankingCustomerInformation != null)
            //    {
            //        lblCIF.Text = objEBankingCustomerInformation.CustomerID;
            //        lblCustomerName.Text = objEBankingCustomerInformation.VNCustomerName;
            //        lblCMND.Text = objEBankingCustomerInformation.LegalID;
            //        if (!string.IsNullOrEmpty(objEBankingCustomerInformation.Telephone))
            //        {
            //            lblTelephone.Text = objEBankingCustomerInformation.Telephone;
            //        }
            //        else
            //        {
            //            lblTelephone.Text = objEBankingCustomerInformation.SMSNumber.Replace("#", " ");
            //        }
            //        lblAddress.Text = objEBankingCustomerInformation.Address.Replace("ý", " ");
            //        string strAccount = string.Empty;
            //        using (eCS.IeCSClient objIeCSClient = new eCS.IeCSClient())
            //        {
            //            DataSet ds = objIeCSClient.GetAccount(txtCIF.Text.Trim(), ref result, ref response);
            //            if (result && ds != null && ds.Tables.Count > 0)
            //            {
            //                foreach (DataRow item in ds.Tables[0].Rows)
            //                {
            //                    strAccount += item["ACCOUNT_NUMBER"].ToString() + "; ";
            //                }
            //            }
            //        }
            //        bValidate = true;
            //        lblAccountNumber.Text = strAccount;
            //    }
            //    else
            //    {
            //        lblMessage.Text = "Thông tin khách hàng không phù hợp. " + response;
            //    }
            //}

            if (bValidate)
            {
                using (DataModel.BLACKLIST_CUSTOMER_BO objBLACKLIST_CUSTOMER_BO = new DataModel.BLACKLIST_CUSTOMER_BO())
                {
                    DataModel.BLACKLIST_CUSTOMER objBLACKLIST_CUSTOMER = objBLACKLIST_CUSTOMER_BO.GetByCUSTOMER_ID(txtCIF.Text);
                    if (objBLACKLIST_CUSTOMER != null)
                    {
                        lblMessage.Text = "Yêu cầu cấp lì xì không hợp lệ. Khách hàng thuộc danh sách cán bộ, nhân viên GPBank. Đề nghị kiểm tra lại thông tin.";
                        bValidate       = false;
                    }
                }
            }

            if (bValidate)
            {
                using (DataModel.LiXi_BO objLiXi_BO = new DataModel.LiXi_BO())
                {
                    DataModel.LiXi objLiXi = objLiXi_BO.GetByCIF(txtCIF.Text);
                    if (objLiXi != null)
                    {
                        string strPGD = string.Empty;
                        using (DataModel.COMPANY_BO objT24_COMPANY_BO = new DataModel.COMPANY_BO())
                        {
                            DataModel.COMPANY objT24_COMPANY = objT24_COMPANY_BO.GetByCOMPANY_CODE(objLiXi.CoCode);
                            if (objT24_COMPANY != null)
                            {
                                strPGD = objT24_COMPANY.COMPANY_NAME;
                            }
                        }
                        lblMessage.Text = "Khách hàng " + lblCustomerName.Text + " đã được cấp Lì xì vào " + objLiXi.Created.Value.ToString("dd/MM/yyyy HH:mm") + " tại " + strPGD + ". Đề nghị kiểm tra lại thông tin.";
                        bValidate       = false;
                    }
                    else
                    {
                        DateTime dtNow  = DateTime.Now;
                        DateTime dtFrom = new DateTime(dtNow.Year, dtNow.Month, dtNow.Day, 0, 0, 1);
                        DateTime dtTo   = new DateTime(dtNow.Year, dtNow.Month, dtNow.Day, 23, 59, 59);
                        List <DataModel.LiXi> lstData = objLiXi_BO.GetByCoCode(cboBranch.SelectedItem.Value, dtFrom, dtTo).ToList();
                        if (lstData != null)
                        {
                            lstData        = lstData.Where(o => !o.IsUsed.HasValue || (o.IsUsed.HasValue && o.IsUsed.Value)).ToList();
                            lblAmount.Text = lstData.Count.ToString();
                            if (lstData.Count < MAX_LIXI)
                            {
                                bValidate = true;
                            }
                            else
                            {
                                bValidate       = false;
                                lblMessage.Text = "Yêu cầu cấp Lì xì không hợp lệ. Điểm giao dịch đã cấp đủ số lượng (" + MAX_LIXI.ToString() + ") Lì xì trong ngày. Đề nghị kiểm tra lại thông tin.";
                            }
                        }
                    }
                }
            }

            if (bValidate)
            {
                cmdAgree.Visible = true;
            }
        }
Esempio n. 2
0
        protected void cmdSearch_Click(object sender, EventArgs e)
        {
            lblMessage.Text = string.Empty;

            lblCIF.Text           = string.Empty;
            lblCustomerName.Text  = string.Empty;
            lblCMND.Text          = string.Empty;
            lblTelephone.Text     = string.Empty;
            lblAddress.Text       = string.Empty;
            lblAccountNumber.Text = string.Empty;
            lblAmount.Text        = string.Empty;

            if (string.IsNullOrEmpty(txtCIF.Text))
            {
                lblMessage.Text = "Nhập mã khách hàng";
                txtCIF.Focus();
                return;
            }

            if (string.IsNullOrEmpty(cboBranch.SelectedItem.Value))
            {
                lblMessage.Text = "Chọn chi nhánh";
                cboBranch.Focus();
                return;
            }
            bool bValidate = false;

            using (PromotionEntities db = new PromotionEntities())
            {
                var cust = db.CUSTOMERs.FirstOrDefault(t => t.CUSTOMER_CODE.Equals(txtCIF.Text));
                if (cust != null)
                {
                    lblCIF.Text          = cust.CUSTOMER_CODE;
                    lblCustomerName.Text = cust.CUSTOMER_NAME;
                    lblCMND.Text         = cust.LEGAL_ID;
                    if (!string.IsNullOrEmpty(cust.TELEPHONE))
                    {
                        lblTelephone.Text = cust.TELEPHONE;
                    }
                    if (!string.IsNullOrEmpty(cust.ADDRESS))
                    {
                        lblAddress.Text = cust.ADDRESS;
                    }
                    string strAccount = string.Empty;

                    var listAcc = db.AZ_ACCOUNT.Where(t => t.CUSTOMER_ID.Equals(txtCIF.Text.Trim())).ToList();
                    if (listAcc != null)
                    {
                        foreach (var azAccount in listAcc)
                        {
                            //strAccount += azAccount.ACCOUNT_NUMBER + "; ";
                        }
                    }

                    bValidate             = true;
                    lblAccountNumber.Text = strAccount;
                }
                else
                {
                    lblMessage.Text = "Thông tin khách hàng không phù hợp. ";
                }
            }

            if (bValidate)
            {
                using (DataModel.BLACKLIST_CUSTOMER_BO objBLACKLIST_CUSTOMER_BO = new DataModel.BLACKLIST_CUSTOMER_BO())
                {
                    DataModel.BLACKLIST_CUSTOMER objBLACKLIST_CUSTOMER = objBLACKLIST_CUSTOMER_BO.GetByCUSTOMER_ID(txtCIF.Text);
                    if (objBLACKLIST_CUSTOMER != null)
                    {
                        lblMessage.Text = "Yêu cầu cấp lì xì không hợp lệ. Khách hàng thuộc danh sách cán bộ, nhân viên GPBank. Đề nghị kiểm tra lại thông tin.";
                        bValidate       = false;
                    }
                }
            }

            if (bValidate)
            {
                using (DataModel.LiXi_BO objLiXi_BO = new DataModel.LiXi_BO())
                {
                    DataModel.LiXi objLiXi = objLiXi_BO.GetByCIF(txtCIF.Text);
                    if (objLiXi != null)
                    {
                        string strPGD = string.Empty;
                        using (DataModel.COMPANY_BO objT24_COMPANY_BO = new DataModel.COMPANY_BO())
                        {
                            DataModel.COMPANY objT24_COMPANY = objT24_COMPANY_BO.GetByCOMPANY_CODE(objLiXi.CoCode);
                            if (objT24_COMPANY != null)
                            {
                                strPGD = objT24_COMPANY.COMPANY_NAME;
                            }
                        }
                        lblMessage.Text = "Khách hàng " + lblCustomerName.Text + " đã được cấp Lì xì vào " + objLiXi.Created.Value.ToString("dd/MM/yyyy HH:mm") + " tại " + strPGD + ". Đề nghị kiểm tra lại thông tin.";
                        bValidate       = false;
                    }
                    else
                    {
                        DateTime dtNow  = DateTime.Now;
                        DateTime dtFrom = new DateTime(dtNow.Year, dtNow.Month, dtNow.Day, 0, 0, 1);
                        DateTime dtTo   = new DateTime(dtNow.Year, dtNow.Month, dtNow.Day, 23, 59, 59);
                        List <DataModel.LiXi> lstData = objLiXi_BO.GetByCoCode(cboBranch.SelectedItem.Value, dtFrom, dtTo).ToList();
                        if (lstData != null)
                        {
                            lstData        = lstData.Where(o => !o.IsUsed.HasValue || (o.IsUsed.HasValue && o.IsUsed.Value)).ToList();
                            lblAmount.Text = lstData.Count.ToString();
                            if (lstData.Count < MAX_LIXI)
                            {
                                bValidate = true;
                            }
                            else
                            {
                                bValidate       = false;
                                lblMessage.Text = "Yêu cầu cấp Lì xì không hợp lệ. Điểm giao dịch đã cấp đủ số lượng (" + MAX_LIXI.ToString() + ") Lì xì trong ngày. Đề nghị kiểm tra lại thông tin.";
                            }
                        }
                    }
                }
            }

            if (bValidate)
            {
                cmdAgree.Visible = true;
            }
        }
Esempio n. 3
0
        protected void cmdSearch_Click(object sender, EventArgs e)
        {
            lblMessage.Text = string.Empty;

            lblCIF.Text = string.Empty;
            lblCustomerName.Text = string.Empty;
            lblCMND.Text = string.Empty;
            lblTelephone.Text = string.Empty;
            lblAddress.Text = string.Empty;
            lblAccountNumber.Text = string.Empty;
            lblAmount.Text = string.Empty;

            if (string.IsNullOrEmpty(txtCIF.Text))
            {
                lblMessage.Text = "Nhập mã khách hàng";
                txtCIF.Focus();
                return;
            }

            if (string.IsNullOrEmpty(cboBranch.SelectedItem.Value))
            {
                lblMessage.Text = "Chọn chi nhánh";
                cboBranch.Focus();
                return;
            }
            bool bValidate = false;
            //using (eCS.IeCSAdminClient client = new eCS.IeCSAdminClient())
            //{
            //    bool result = true;
            //    string response = string.Empty;
            //    eCS.EBankingCustomerInformation objEBankingCustomerInformation = client.GetCustomerInformation(txtCIF.Text, ref result, ref response);
            //    if (result && objEBankingCustomerInformation != null)
            //    {
            //        lblCIF.Text = objEBankingCustomerInformation.CustomerID;
            //        lblCustomerName.Text = objEBankingCustomerInformation.VNCustomerName;
            //        lblCMND.Text = objEBankingCustomerInformation.LegalID;
            //        if (!string.IsNullOrEmpty(objEBankingCustomerInformation.Telephone))
            //        {
            //            lblTelephone.Text = objEBankingCustomerInformation.Telephone;
            //        }
            //        else
            //        {
            //            lblTelephone.Text = objEBankingCustomerInformation.SMSNumber.Replace("#", " ");
            //        }
            //        lblAddress.Text = objEBankingCustomerInformation.Address.Replace("ý", " ");
            //        string strAccount = string.Empty;
            //        using (eCS.IeCSClient objIeCSClient = new eCS.IeCSClient())
            //        {
            //            DataSet ds = objIeCSClient.GetAccount(txtCIF.Text.Trim(), ref result, ref response);
            //            if (result && ds != null && ds.Tables.Count > 0)
            //            {
            //                foreach (DataRow item in ds.Tables[0].Rows)
            //                {
            //                    strAccount += item["ACCOUNT_NUMBER"].ToString() + "; ";
            //                }
            //            }
            //        }
            //        bValidate = true;
            //        lblAccountNumber.Text = strAccount;
            //    }
            //    else
            //    {
            //        lblMessage.Text = "Thông tin khách hàng không phù hợp. " + response;
            //    }
            //}

            if (bValidate)
            {
                using (DataModel.BLACKLIST_CUSTOMER_BO objBLACKLIST_CUSTOMER_BO = new DataModel.BLACKLIST_CUSTOMER_BO())
                {
                    DataModel.BLACKLIST_CUSTOMER objBLACKLIST_CUSTOMER = objBLACKLIST_CUSTOMER_BO.GetByCUSTOMER_ID(txtCIF.Text);
                    if (objBLACKLIST_CUSTOMER != null)
                    {
                        lblMessage.Text = "Yêu cầu cấp lì xì không hợp lệ. Khách hàng thuộc danh sách cán bộ, nhân viên GPBank. Đề nghị kiểm tra lại thông tin.";
                        bValidate = false;
                    }
                }
            }

            if (bValidate)
            {
                using (DataModel.LiXi_BO objLiXi_BO = new DataModel.LiXi_BO())
                {
                    DataModel.LiXi objLiXi = objLiXi_BO.GetByCIF(txtCIF.Text);
                    if (objLiXi != null)
                    {
                        string strPGD = string.Empty;
                        using (DataModel.COMPANY_BO objT24_COMPANY_BO = new DataModel.COMPANY_BO())
                        {
                            DataModel.COMPANY objT24_COMPANY = objT24_COMPANY_BO.GetByCOMPANY_CODE(objLiXi.CoCode);
                            if (objT24_COMPANY != null)
                            {
                                strPGD = objT24_COMPANY.COMPANY_NAME;
                            }
                        }
                        lblMessage.Text = "Khách hàng " + lblCustomerName.Text + " đã được cấp Lì xì vào " + objLiXi.Created.Value.ToString("dd/MM/yyyy HH:mm") + " tại " + strPGD + ". Đề nghị kiểm tra lại thông tin.";
                        bValidate = false;
                    }
                    else
                    {
                        DateTime dtNow = DateTime.Now;
                        DateTime dtFrom = new DateTime(dtNow.Year, dtNow.Month, dtNow.Day, 0, 0, 1);
                        DateTime dtTo = new DateTime(dtNow.Year, dtNow.Month, dtNow.Day, 23, 59, 59);
                        List<DataModel.LiXi> lstData = objLiXi_BO.GetByCoCode(cboBranch.SelectedItem.Value, dtFrom, dtTo).ToList();
                        if (lstData != null)
                        {
                            lstData = lstData.Where(o => !o.IsUsed.HasValue || (o.IsUsed.HasValue && o.IsUsed.Value)).ToList();
                            lblAmount.Text = lstData.Count.ToString();
                            if (lstData.Count < MAX_LIXI)
                            {
                                bValidate = true;
                            }
                            else
                            {
                                bValidate = false;
                                lblMessage.Text = "Yêu cầu cấp Lì xì không hợp lệ. Điểm giao dịch đã cấp đủ số lượng (" + MAX_LIXI.ToString() + ") Lì xì trong ngày. Đề nghị kiểm tra lại thông tin.";
                            }
                        }
                    }
                }
            }

            if (bValidate)
            {
                cmdAgree.Visible = true;
            }

        }