コード例 #1
0
 public STAFF_USER_BO()
 {
     db = new PromotionEntities();
 }
コード例 #2
0
ファイル: XoaLiXi.aspx.cs プロジェクト: manhtr/Promotion
        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. ";
                    }
                }
            }
        }
コード例 #3
0
ファイル: DelSerial_BO.cs プロジェクト: manhtr/Promotion
 public DelSerial_BO()
 {
     db = new PromotionEntities();
 }
コード例 #4
0
ファイル: SerialMax_BO.cs プロジェクト: manhtr/Promotion
 public SerialMax_BO()
 {
     db = new PromotionEntities();
 }
コード例 #5
0
ファイル: Function.cs プロジェクト: manhtr/Promotion
        //public SerialBook GetSerialBookFromT24(string strBookNumber, string strHost, string strPort, string strService, string strUserId, string strPwd, string strSchema, string strBOOK_TYPE, string strCIF, ref string strCategory)
        public SerialBook GetSerialBookFromT24(string strBookNumber, string strBOOK_TYPE, string strCIF, ref string strCategory)
        {
            SerialBook oBook = null;
            using (PromotionEntities db = new PromotionEntities())
            {
                bool bResult = false;
                string strResponse = string.Empty;

                try
                {
                    //string strAZCommandText = "SELECT ID,PASSBOOK.NUMBER,CUSTOMER,CURRENCY,PRINCIPAL,VALUE.DATE,MATURITY.DATE,CO.CODE,TERM FROM " + strSchema + ".";
                    //strAZCommandText += "FBNK_AZ_ACCOUNT WHERE PASSBOOK.NUMBER='" + strBookNumber + "'";

                    //string strLDCommandText = "SELECT ID,CONTRACT.NO,CUSTOMER.ID,CURRENCY,AMOUNT,VALUE.DATE,FIN.MAT.DATE,CO.CODE,TERM FROM " + strSchema + ".";
                    //strLDCommandText += "FBNK_LD_L002 WHERE CONTRACT.NO='" + strBookNumber + "'";

                    if (strBOOK_TYPE.ToUpper() == "AZ")
                    {
                        strResponse = string.Empty;
                        var lstAZByCustomerID = db.AZ_ACCOUNT.Where(t => t.CUSTOMER_ID.Equals(strCIF));
                        if(lstAZByCustomerID != null)
                        {
                            foreach (var azAccount in lstAZByCustomerID)
                            {
                                Commons.Convertion _oConvertion = new Commons.Convertion();
                                if (azAccount.PASSBOOK_NUMBER != null && azAccount.PASSBOOK_NUMBER == strBookNumber)
                                {
                                    oBook = new SerialBook();
                                    oBook.Book_Number = azAccount.PASSBOOK_NUMBER;
                                    oBook.Customer_Id = azAccount.CUSTOMER_ID;
                                    oBook.Currency = azAccount.CURRENCY;
                                    oBook.TotalAmount = Convert.ToDouble(azAccount.PRINCIPAL);
                                    oBook.ValueDate = Convert.ToDateTime(azAccount.VALUE_DATE);
                                    oBook.MaturityDate = Convert.ToDateTime(azAccount.MATURITY_DATE);
                                    oBook.ACCOUNT_NUMBER = azAccount.ACCOUNT_NUMBER;
                                    oBook.CO_CODE = azAccount.CO_CODE;
                                    if (azAccount.THAM_GIA_KM != null)
                                    {
                                        oBook.ThamGiaKM = azAccount.THAM_GIA_KM;
                                    }
                                    if (azAccount.TERM != null && !string.IsNullOrEmpty(azAccount.TERM))
                                    {
                                        oBook.TERM = azAccount.TERM;
                                    }
                                    strCategory = azAccount.CATEGORY;

                                    //reset response
                                    strResponse = string.Empty;
                                    var objCust = db.CUSTOMERs.FirstOrDefault(t => t.CUSTOMER_CODE.Equals(oBook.Customer_Id));
                                    if(objCust != null)
                                    {
                                        oBook.Customer_Name = objCust.CUSTOMER_NAME;
                                        oBook.CMTND = objCust.LEGAL_ID;
                                        oBook.Sector = objCust.SECTOR;
                                        oBook.Telephone = objCust.TELEPHONE;
                                    }
                                    break;
                                }
                            }
                        }
                    }
                    else //LD
                    {
                        strResponse = string.Empty;
                        var objLD = db.AZ_ACCOUNT.SingleOrDefault(t => t.PASSBOOK_NUMBER.Equals(strBookNumber));
                        if(objLD != null)
                        {
                            Commons.Convertion _oConvertion = new Commons.Convertion();
                            oBook = new SerialBook();
                            oBook.Book_Number = objLD.PASSBOOK_NUMBER;
                            oBook.Customer_Id = objLD.CUSTOMER_ID;
                            oBook.Currency = objLD.CURRENCY;
                            oBook.TotalAmount = Convert.ToDouble(objLD.PRINCIPAL);
                            oBook.ValueDate = Convert.ToDateTime(objLD.VALUE_DATE);
                            oBook.MaturityDate = Convert.ToDateTime(objLD.MATURITY_DATE); ;
                            oBook.ACCOUNT_NUMBER = objLD.ACCOUNT_NUMBER;
                            oBook.CO_CODE = objLD.CO_CODE;
                            if (objLD.TERM != null && !string.IsNullOrEmpty(objLD.TERM))
                            {
                                oBook.TERM = objLD.TERM;
                            }
                            strCategory = objLD.CATEGORY;

                            //reset response
                            strResponse = string.Empty;
                            var objCust = db.CUSTOMERs.FirstOrDefault(t => t.CUSTOMER_CODE.Equals(oBook.Customer_Id));
                            if (objCust != null)
                            {
                                oBook.Customer_Name = objCust.CUSTOMER_NAME;
                                oBook.CMTND = objCust.LEGAL_ID;
                                oBook.Sector = objCust.SECTOR;
                                oBook.Telephone = objCust.TELEPHONE;
                            }
                        }
                    }
                }
                catch (Exception oExc)
                {
                    log.Error(oExc.Message);
                }
                if (oBook != null)
                {
                    oBook.Customer_Name = SplitT24CustomerName(oBook.Customer_Name);
                    TimeSpan ts = oBook.MaturityDate - oBook.ValueDate;
                    int nPeriod = (int)(ts.TotalDays / 30);
                    int nRemain = (int)(ts.TotalDays % 30);
                    if (nRemain >= 28) nPeriod++;
                    if (nPeriod > 0)
                    {
                        oBook.PeriodInWord = string.Format("{0} tháng.", nPeriod.ToString());
                    }
                    else
                    {
                        int nWeeks = nRemain / 7;
                        oBook.PeriodInWord = string.Format("{0} tuần.", nWeeks.ToString());
                    }
                }
            }

            return oBook;
        }
コード例 #6
0
ファイル: User_BO.cs プロジェクト: MyTan/Promotion
 public User_BO()
 {
     db = new PromotionEntities();
 }
コード例 #7
0
ファイル: STAFF_USER_BO.cs プロジェクト: manhtr/Promotion
 public STAFF_USER_BO()
 {
     db = new PromotionEntities();
 }
コード例 #8
0
 public LiXi_BO()
 {
     db = new PromotionEntities();
 }
コード例 #9
0
ファイル: SerialResult_BO.cs プロジェクト: manhtr/Promotion
 public SerialResult_BO()
 {
     db = new PromotionEntities();
 }
コード例 #10
0
ファイル: LuckySerial_BO.cs プロジェクト: manhtr/Promotion
 public LuckySerial_BO()
 {
     db = new PromotionEntities();
 }
コード例 #11
0
ファイル: SerialResult_BO.cs プロジェクト: manhtr/Promotion
 public SerialResult_BO()
 {
     db = new PromotionEntities();
 }
コード例 #12
0
ファイル: LiXi_BO.cs プロジェクト: manhtr/Promotion
 public LiXi_BO()
 {
     db = new PromotionEntities();
 }
コード例 #13
0
 public DAO_BO()
 {
     db = new PromotionEntities();
 }
コード例 #14
0
ファイル: SerialByMonth_BO.cs プロジェクト: manhtr/Promotion
 public SerialByMonth_BO()
 {
     db = new PromotionEntities();
 }
コード例 #15
0
 public SerialMax_BO()
 {
     db = new PromotionEntities();
 }
コード例 #16
0
ファイル: SerialByWeek_BO.cs プロジェクト: manhtr/Promotion
 public SerialByWeek_BO()
 {
     db = new PromotionEntities();
 }
コード例 #17
0
 public BLACKLIST_CUSTOMER_BO()
 {
     db = new PromotionEntities();
 }
コード例 #18
0
ファイル: SerialByMonth_BO.cs プロジェクト: manhtr/Promotion
 public SerialByMonth_BO()
 {
     db = new PromotionEntities();
 }
コード例 #19
0
ファイル: DelSerial_BO.cs プロジェクト: manhtr/Promotion
 public DelSerial_BO()
 {
     db = new PromotionEntities();
 }
コード例 #20
0
ファイル: SerialByWeek_BO.cs プロジェクト: manhtr/Promotion
 public SerialByWeek_BO()
 {
     db = new PromotionEntities();
 }
コード例 #21
0
 public LuckySerial_BO()
 {
     db = new PromotionEntities();
 }
コード例 #22
0
 public COMPANY_BO()
 {
     db = new PromotionEntities();
 }
コード例 #23
0
ファイル: DAO_COMPANY_BO.cs プロジェクト: manhtr/Promotion
 public DAO_COMPANY_BO()
 {
     db = new PromotionEntities();
 }
コード例 #24
0
 public BLACKLIST_CUSTOMER_BO()
 {
     db = new PromotionEntities();
 }
コード例 #25
0
ファイル: User_BO.cs プロジェクト: manhtr/Promotion
 public User_BO()
 {
     db = new PromotionEntities();
 }
コード例 #26
0
ファイル: DAO_BO.cs プロジェクト: manhtr/Promotion
 public DAO_BO()
 {
     db = new PromotionEntities();
 }