示例#1
0
        protected void dxgvSerial_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
        {
            if (e.RowType == DevExpress.Web.GridViewRowType.Data)
            {
                Label lbl = dxgvSerial.FindRowCellTemplateControl(e.VisibleIndex, null, "lblBranchName") as Label;
                string strCoCode = e.GetValue("CO_CODE").ToString();
                if (lbl != null && strCoCode != string.Empty)
                {
                    using (DataModel.COMPANY_BO objT24_COMPANY_BO = new DataModel.COMPANY_BO())
                    {
                        DataModel.COMPANY objT24_COMPANY = objT24_COMPANY_BO.GetByCOMPANY_CODE(strCoCode);
                        if (objT24_COMPANY != null)
                        {
                            lbl.Text = objT24_COMPANY.COMPANY_NAME;
                        }
                    }
                }

                Label lbl2 = dxgvSerial.FindRowCellTemplateControl(e.VisibleIndex, null, "lblStatus") as Label;
                if (lbl2 != null)
                {
                    if (e.GetValue("IsUsed") != null)
                    {
                        bool strStatus = Convert.ToBoolean(e.GetValue("IsUsed"));

                        if (strStatus)
                        {
                            lbl2.Text = "Đã cấp mã";
                        }
                        else
                        {
                            lbl2.Text = "Đã xóa";
                        }
                    }
                    else
                    {
                        lbl2.Text = "Đã cấp mã";
                    }
                }

                Label lbl3 = dxgvSerial.FindRowCellTemplateControl(e.VisibleIndex, null, "lblMaDuThuong") as Label;
                if (lbl3 != null)
                {
                    if (e.GetValue("Serials") != null)
                    {
                        string strSerials = e.GetValue("Serials").ToString();
                        if (!string.IsNullOrEmpty(strSerials))
                        {
                            strSerials = Commons.Common.FormatSerial(strSerials.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries).ToList());
                        }

                        lbl3.Text = strSerials;
                    }
                    else
                    {
                        lbl3.Text = string.Empty;
                    }
                }
            }
        }
示例#2
0
        protected void dxgvSerial_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
        {
            if (e.RowType == DevExpress.Web.GridViewRowType.Data)
            {
                Label  lbl       = dxgvSerial.FindRowCellTemplateControl(e.VisibleIndex, null, "lblBranchName") as Label;
                string strCoCode = e.GetValue("CO_CODE").ToString();
                if (lbl != null && strCoCode != string.Empty)
                {
                    using (DataModel.COMPANY_BO objT24_COMPANY_BO = new DataModel.COMPANY_BO())
                    {
                        DataModel.COMPANY objT24_COMPANY = objT24_COMPANY_BO.GetByCOMPANY_CODE(strCoCode);
                        if (objT24_COMPANY != null)
                        {
                            lbl.Text = objT24_COMPANY.COMPANY_NAME;
                        }
                    }
                }

                Label lbl2 = dxgvSerial.FindRowCellTemplateControl(e.VisibleIndex, null, "lblStatus") as Label;
                if (lbl2 != null)
                {
                    if (e.GetValue("IsUsed") != null)
                    {
                        bool strStatus = Convert.ToBoolean(e.GetValue("IsUsed"));

                        if (strStatus)
                        {
                            lbl2.Text = "Đã cấp mã";
                        }
                        else
                        {
                            lbl2.Text = "Đã xóa";
                        }
                    }
                    else
                    {
                        lbl2.Text = "Đã cấp mã";
                    }
                }

                Label lbl3 = dxgvSerial.FindRowCellTemplateControl(e.VisibleIndex, null, "lblMaDuThuong") as Label;
                if (lbl3 != null)
                {
                    if (e.GetValue("Serials") != null)
                    {
                        string strSerials = e.GetValue("Serials").ToString();
                        if (!string.IsNullOrEmpty(strSerials))
                        {
                            strSerials = Commons.Common.FormatSerial(strSerials.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries).ToList());
                        }

                        lbl3.Text = strSerials;
                    }
                    else
                    {
                        lbl3.Text = string.Empty;
                    }
                }
            }
        }
示例#3
0
 private void BindBranch()
 {
     using (DataModel.COMPANY_BO objT24_COMPANY_BO = new DataModel.COMPANY_BO())
     {
         List <DataModel.COMPANY> lstData = objT24_COMPANY_BO.GetAll().ToList();
         foreach (DataModel.COMPANY item in lstData)
         {
             cboBranch.Items.Add(new ListItem(item.COMPANY_CODE + "-" + item.COMPANY_NAME, item.COMPANY_CODE));
         }
         cboBranch.Items.Insert(0, new ListItem("--Chọn CN/PGD--", string.Empty));
         if (Session[Commons.Constant.DAO_CODE] != null)
         {
             cboBranch.ClearSelection();
             using (DataModel.DAO_COMPANY_BO objDAO_COMPANY_BO = new DataModel.DAO_COMPANY_BO())
             {
                 List <DataModel.DAO_COMPANY> lstDaoCompany = objDAO_COMPANY_BO.GetByDAO_CODE(Session[Commons.Constant.DAO_CODE].ToString()).ToList();
                 if (lstDaoCompany != null)
                 {
                     foreach (DataModel.DAO_COMPANY item in lstDaoCompany)
                     {
                         if (item.DAO_CODE == Session[Commons.Constant.DAO_CODE].ToString() && !string.IsNullOrEmpty(item.COMPANY_CODE.Trim()))
                         {
                             if (cboBranch.Items.FindByValue(item.COMPANY_CODE) != null)
                             {
                                 cboBranch.Items.FindByValue(item.COMPANY_CODE).Selected = true;
                             }
                             break;
                         }
                     }
                 }
             }
         }
     }
 }
示例#4
0
        private void BindBranchInfo()
        {
            lblCoCode.Text        = string.Empty;
            lblBranchName.Text    = string.Empty;
            lblBranchAddress.Text = string.Empty;
            lblAmount.Text        = string.Empty;

            if (!string.IsNullOrEmpty(cboBranch.SelectedItem.Value))
            {
                using (DataModel.COMPANY_BO objT24_COMPANY_BO = new DataModel.COMPANY_BO())
                {
                    DataModel.COMPANY objT24_COMPANY = objT24_COMPANY_BO.GetByCOMPANY_CODE(cboBranch.SelectedItem.Value);
                    if (objT24_COMPANY != null)
                    {
                        lblCoCode.Text        = objT24_COMPANY.COMPANY_CODE;
                        lblBranchName.Text    = objT24_COMPANY.COMPANY_NAME;
                        lblBranchAddress.Text = objT24_COMPANY.NAME_ADDRESS.Replace("ý", string.Empty);
                    }
                }
            }
        }
示例#5
0
 private void BindBranch()
 {
     using (DataModel.COMPANY_BO objT24_COMPANY_BO = new DataModel.COMPANY_BO())
     {
         List <DataModel.COMPANY> lstData = objT24_COMPANY_BO.GetAll().ToList();
         foreach (DataModel.COMPANY item in lstData)
         {
             cboBranch.Items.Add(new ListItem(item.COMPANY_CODE + "-" + item.COMPANY_NAME, item.COMPANY_CODE));
         }
         cboBranch.Items.Insert(0, new ListItem("--Chọn chi nhánh--", string.Empty));
         if (Session[Commons.Constant.DAO_CODE] != null)
         {
             cboBranch.ClearSelection();
             if (cboBranch.Items.FindByValue(Session[Commons.Constant.DAO_CODE].ToString()) != null)
             {
                 cboBranch.Items.FindByValue(Session[Commons.Constant.DAO_CODE].ToString()).Selected = true;
             }
         }
         using (DataModel.User_BO objUser_BO = new DataModel.User_BO())
         {
             DataModel.User objUser = objUser_BO.GetByUserName(Session[Commons.Constant.USERNAME].ToString());
             if (objUser != null && objUser.Permisions != null)
             {
                 bool hasPer = false;
                 foreach (DataModel.Permision item in objUser.Permisions)
                 {
                     if (item != null && item.Permision1 == Commons.Constant.PERMISION_ADMIN)
                     {
                         hasPer = true;
                         break;
                     }
                 }
                 if (hasPer)
                 {
                     cboBranch.Enabled = true;
                 }
             }
         }
     }
 }
示例#6
0
        protected void grvExport_RenderBrick(object sender, DevExpress.Web.ASPxGridViewExportRenderingEventArgs e)
        {
            GridViewDataColumn dataColumn = e.Column as GridViewDataColumn;

            if (e.RowType == GridViewRowType.Data && dataColumn != null && dataColumn.VisibleIndex == 7)
            {
                if (e.GetValue("Serials") != null)
                {
                    string strSerials = e.GetValue("Serials").ToString();
                    if (!string.IsNullOrEmpty(strSerials))
                    {
                        strSerials = Commons.Common.FormatSerial(strSerials.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries).ToList());
                    }

                    e.TextValue = strSerials;
                }
                else
                {
                    e.TextValue = string.Empty;
                }
            }

            dataColumn = e.Column as GridViewDataColumn;
            if (e.RowType == GridViewRowType.Data && dataColumn != null && dataColumn.VisibleIndex == 9)
            {
                string strCoCode = e.GetValue("CO_CODE").ToString();
                if (strCoCode != string.Empty)
                {
                    using (DataModel.COMPANY_BO objT24_COMPANY_BO = new DataModel.COMPANY_BO())
                    {
                        DataModel.COMPANY objT24_COMPANY = objT24_COMPANY_BO.GetByCOMPANY_CODE(strCoCode);
                        if (objT24_COMPANY != null)
                        {
                            e.TextValue = objT24_COMPANY.COMPANY_NAME;
                        }
                    }
                }
            }

            dataColumn = e.Column as GridViewDataColumn;
            if (e.RowType == GridViewRowType.Data && dataColumn != null && dataColumn.VisibleIndex == 10)
            {
                if (e.GetValue("IsUsed") != null)
                {
                    bool strStatus = Convert.ToBoolean(e.GetValue("IsUsed"));

                    if (strStatus)
                    {
                        e.TextValue = "Đã cấp mã";
                    }
                    else
                    {
                        e.TextValue = "Đã xóa";
                    }
                }
                else
                {
                    e.TextValue = "Đã cấp mã";
                }
            }
        }
示例#7
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;
            lblStatus.Text        = string.Empty;

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

            if (Session[Constant.USERNAME] != null)
            {
                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 + "; ";
                            }
                        }

                        lblAccountNumber.Text = strAccount;
                        hdfCIF.Value          = txtCIF.Text.Trim();
                        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;
                                    }
                                }
                                lblStatus.Text    = "Đã được cấp Lì xì vào " + objLiXi.Created.Value.ToString("dd/MM/yyyy HH:mm") + " tại " + strPGD + ". Cấp bởi " + objLiXi.CreatedBy;
                                cmdDelete.Visible = true;
                            }
                            else
                            {
                                lblStatus.Text = "Khách hàng chưa được cấp Lì xì";
                            }
                        }
                    }
                    else
                    {
                        lblMessage.Text = "Thông tin khách hàng không phù hợp. ";
                    }
                }
            }
        }
示例#8
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;
            }
        }
示例#9
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;
            }
        }
示例#10
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;
            lblStatus.Text = string.Empty;

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

            if (Session[Constant.USERNAME] != null)
            {
                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 + "; ";
                            }
                        }

                        lblAccountNumber.Text = strAccount;
                        hdfCIF.Value = txtCIF.Text.Trim();
                        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;
                                    }
                                }
                                lblStatus.Text = "Đã được cấp Lì xì vào " + objLiXi.Created.Value.ToString("dd/MM/yyyy HH:mm") + " tại " + strPGD + ". Cấp bởi " + objLiXi.CreatedBy;
                                cmdDelete.Visible = true;
                            }
                            else
                            {
                                lblStatus.Text = "Khách hàng chưa được cấp Lì xì";
                            }
                        }
                    }
                    else
                    {
                        lblMessage.Text = "Thông tin khách hàng không phù hợp. ";
                    }
                }
            }
        }
示例#11
0
 private void BindBranch()
 {
     using (DataModel.COMPANY_BO objT24_COMPANY_BO = new DataModel.COMPANY_BO())
     {
         List<DataModel.COMPANY> lstData = objT24_COMPANY_BO.GetAll().ToList();
         foreach (DataModel.COMPANY item in lstData)
         {
             cboBranch.Items.Add(new ListItem(item.COMPANY_CODE + "-" + item.COMPANY_NAME, item.COMPANY_CODE));
         }
         cboBranch.Items.Insert(0, new ListItem("--Chọn chi nhánh--", string.Empty));
         if (Session[Commons.Constant.DAO_CODE] != null)
         {
             cboBranch.ClearSelection();
             if (cboBranch.Items.FindByValue(Session[Commons.Constant.DAO_CODE].ToString()) != null)
             {
                 cboBranch.Items.FindByValue(Session[Commons.Constant.DAO_CODE].ToString()).Selected = true;
             }
         }
         using (DataModel.User_BO objUser_BO = new DataModel.User_BO())
         {
             DataModel.User objUser = objUser_BO.GetByUserName(Session[Commons.Constant.USERNAME].ToString());
             if (objUser != null && objUser.Permisions != null)
             {
                 bool hasPer = false;
                 foreach (DataModel.Permision item in objUser.Permisions)
                 {
                     if (item != null && item.Permision1 == Commons.Constant.PERMISION_ADMIN)
                     {
                         hasPer = true;
                         break;
                     }
                 }
                 if (hasPer)
                 {
                     cboBranch.Enabled = true;
                 }
             }
         }
     }
 }
示例#12
0
        protected void grvExport_RenderBrick(object sender, DevExpress.Web.ASPxGridViewExportRenderingEventArgs e)
        {
            GridViewDataColumn dataColumn = e.Column as GridViewDataColumn;
            if (e.RowType == GridViewRowType.Data && dataColumn != null && dataColumn.VisibleIndex == 7)
            {
                if (e.GetValue("Serials") != null)
                {
                    string strSerials = e.GetValue("Serials").ToString();
                    if (!string.IsNullOrEmpty(strSerials))
                    {
                        strSerials = Commons.Common.FormatSerial(strSerials.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries).ToList());
                    }

                    e.TextValue = strSerials;
                }
                else
                {
                    e.TextValue = string.Empty;
                }
            }

            dataColumn = e.Column as GridViewDataColumn;
            if (e.RowType == GridViewRowType.Data && dataColumn != null && dataColumn.VisibleIndex == 9)
            {
                string strCoCode = e.GetValue("CO_CODE").ToString();
                if (strCoCode != string.Empty)
                {
                    using (DataModel.COMPANY_BO objT24_COMPANY_BO = new DataModel.COMPANY_BO())
                    {
                        DataModel.COMPANY objT24_COMPANY = objT24_COMPANY_BO.GetByCOMPANY_CODE(strCoCode);
                        if (objT24_COMPANY != null)
                        {
                            e.TextValue = objT24_COMPANY.COMPANY_NAME;
                        }
                    }
                }
            }

            dataColumn = e.Column as GridViewDataColumn;
            if (e.RowType == GridViewRowType.Data && dataColumn != null && dataColumn.VisibleIndex == 10)
            {
                if (e.GetValue("IsUsed") != null)
                {
                    bool strStatus = Convert.ToBoolean(e.GetValue("IsUsed"));

                    if (strStatus)
                    {
                        e.TextValue = "Đã cấp mã";
                    }
                    else
                    {
                        e.TextValue = "Đã xóa";
                    }
                }
                else
                {
                    e.TextValue = "Đã cấp mã";
                }
            }
        }
示例#13
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;
            }

        }
示例#14
0
        private void BindBranchInfo()
        {
            lblCoCode.Text = string.Empty;
            lblBranchName.Text = string.Empty;
            lblBranchAddress.Text = string.Empty;
            lblAmount.Text = string.Empty;

            if (!string.IsNullOrEmpty(cboBranch.SelectedItem.Value))
            {
                using (DataModel.COMPANY_BO objT24_COMPANY_BO = new DataModel.COMPANY_BO())
                {
                    DataModel.COMPANY objT24_COMPANY = objT24_COMPANY_BO.GetByCOMPANY_CODE(cboBranch.SelectedItem.Value);
                    if (objT24_COMPANY != null)
                    {
                        lblCoCode.Text = objT24_COMPANY.COMPANY_CODE;
                        lblBranchName.Text = objT24_COMPANY.COMPANY_NAME;
                        lblBranchAddress.Text = objT24_COMPANY.NAME_ADDRESS.Replace("ý", string.Empty);
                    }
                }
            }
        }
示例#15
0
        private void BindBranch()
        {
            using (DataModel.COMPANY_BO objT24_COMPANY_BO = new DataModel.COMPANY_BO())
            {
                List<DataModel.COMPANY> lstData = objT24_COMPANY_BO.GetAll().ToList();
                foreach (DataModel.COMPANY item in lstData)
                {
                    cboBranch.Items.Add(new ListItem(item.COMPANY_CODE + "-" + item.COMPANY_NAME, item.COMPANY_CODE));
                }
                cboBranch.Items.Insert(0, new ListItem("--Chọn CN/PGD--", string.Empty));
                if (Session[Commons.Constant.DAO_CODE] != null)
                {
                    cboBranch.ClearSelection();
                    using (DataModel.DAO_COMPANY_BO objDAO_COMPANY_BO = new DataModel.DAO_COMPANY_BO())
                    {
                        List<DataModel.DAO_COMPANY> lstDaoCompany = objDAO_COMPANY_BO.GetByDAO_CODE(Session[Commons.Constant.DAO_CODE].ToString()).ToList();
                        if (lstDaoCompany != null)
                        {
                            foreach (DataModel.DAO_COMPANY item in lstDaoCompany)
                            {
                                if (item.DAO_CODE == Session[Commons.Constant.DAO_CODE].ToString() && !string.IsNullOrEmpty(item.COMPANY_CODE.Trim()))
                                {
                                    if (cboBranch.Items.FindByValue(item.COMPANY_CODE) != null)
                                    {
                                        cboBranch.Items.FindByValue(item.COMPANY_CODE).Selected = true;
                                    }
                                    break;
                                }
                            }
                        }
                    }

                }
            }
        }