Example #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         DataTable dataTable = dataLayer.fillClientByClientNumber(Session["UserName"].ToString());
         lblFName.Text   = dataTable.Rows[0]["FirstName"].ToString();
         lblLName.Text   = dataTable.Rows[0]["LastName"].ToString();
         lblNum.Text     = dataTable.Rows[0]["FamilyCount"].ToString();
         txtTel.Text     = dataTable.Rows[0]["Tel"].ToString();
         txtMobile.Text  = dataTable.Rows[0]["Mobile"].ToString();
         txtAddress.Text = dataTable.Rows[0]["Address"].ToString();
     }
 }
Example #2
0
        /// <summary>
        /// جستجوی مشتری
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            Label2.Text = (string)GetLocalResourceObject("Grant_btnSearch_Click_name");
            Label3.Text = (string)GetLocalResourceObject("LName");
            Label4.Text = (string)GetLocalResourceObject("balance");

            var dataTable = dataLayerClass.fillClientByClientNumber(txtClientNum.Text);

            hfClientName.Value = dataTable.Rows[0]["FirstName"].ToString() + " " + dataTable.Rows[0]["LastName"].ToString();
            Label2.Text        = " " + Label2.Text + dataTable.Rows[0]["FirstName"].ToString();
            Label3.Text        = " " + Label3.Text + dataTable.Rows[0]["LastName"].ToString();

            var     accAmount   = dataLayerClass.getParameterById(1);
            decimal familyCount = 1;

            familyCount = Convert.ToDecimal(dataTable.Rows[0]["FamilyCount"].ToString());
            decimal signAmount    = (familyCount * (Convert.ToDecimal((accAmount.value.ToString()))));
            string  txtsignAmount = signAmount.ToString("0,0");

            Label5.Text = (string)GetLocalResourceObject("AccAmount") + txtsignAmount + (string)GetLocalResourceObject("Rial");

            if (dataTable.Rows[0]["Balance"].ToString() != "")
            {
                balanceAmount = (decimal)Convert.ToDouble(dataTable.Rows[0]["Balance"].ToString());
                string balanceString = balanceAmount.ToString("0,0");
                Label4.Text = " " + Label4.Text + balanceString + (string)GetLocalResourceObject("Rial");
            }
            accountId             = Convert.ToDecimal(dataTable.Rows[0]["ID"].ToString());
            hfAccountID.Value     = dataTable.Rows[0]["ID"].ToString();
            hfBalanceAmount.Value = dataTable.Rows[0]["Balance"].ToString();
            hfClientid.Value      = dataTable.Rows[0]["Clientid"].ToString();
            decimal aa = (decimal.Parse(hfBalanceAmount.Value.ToString())) * (decimal)2.5;

            _txtAmountLoan.Text = aa.ToString("0,0");

            plnLoan.Visible      = pnlClientDetail.Visible = true;
            btnok.Enabled        = true;
            lblnote.Text         = "";
            txtClientNum.Enabled = btnSearch.Enabled = false;
        }
Example #3
0
        /// <summary>
        /// جستجوی مشتری
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            Label2.Text = "نام: ";
            Label3.Text = "نام خانوادگی: ";
            Label4.Text = "مانده حساب:  ";

            var dataTable = dataLayerClass.fillClientByClientNumber(txtClientNum.Text);

            DBLayare.Loan   loanInfoClass          = new Loan();
            Loan.LoanStruct?loanInfoByClientNumber = loanInfoClass.getLoanInfoByClientNumber(txtClientNum.Text);
            if (loanInfoByClientNumber != null)
            {
                DBLayare.Loan.LoanStruct loanInfo = (Loan.LoanStruct)loanInfoByClientNumber;
                Label11.Text   = "شماره تسهیلات: " + loanInfo.loanNumber;
                hfLoanId.Value = loanInfo.loanNumber.ToString();

                hfInstallmentAmount.Value = loanInfo.installmentAmount.ToString();
                Label12.Text      = "مبلغ قسط تسهیلات: " + loanInfo.installmentAmount.ToString("0,0") + " ريال";
                Label13.Text      = "وضعیت تسهیلات: ";
                loanPanel.Visible = true;

                switch (loanInfo.loanStatus)
                {
                case 0:
                {
                    Label13.Text = Label13.Text + "جاری";
                    break;
                }

                case 1:
                {
                    Label13.Text      = Label13.Text + "سررسید گذشته";
                    Label13.ForeColor = System.Drawing.Color.Red;
                    break;
                }

                case 2:
                {
                    Label13.Text      = Label13.Text + "مشکوک الوصول";
                    Label13.ForeColor = System.Drawing.Color.Red;
                    break;
                }

                case 3:
                {
                    Label13.Text      = Label13.Text + "تسویه شده";
                    loanPanel.Visible = false;
                    break;
                }
                }
                numberOfinstallment = dataLayerClass.getNumberOfinstallment((int)loanInfo.loanNumber);
                Label9.Text         = numberOfinstallment.ToString();
            }
            else
            {
                loanPanel.Visible = false;
                Label11.Text      = "";
                Label12.Text      = "";
                Label13.Text      = "";
            }
            hfClientName.Value = dataTable.Rows[0]["FirstName"].ToString() + " " + dataTable.Rows[0]["LastName"].ToString();
            Label2.Text        = " " + Label2.Text + dataTable.Rows[0]["FirstName"].ToString();
            Label3.Text        = " " + Label3.Text + dataTable.Rows[0]["LastName"].ToString();

            var     param = dataLayerClass.getParameterById(1);
            decimal aa    = 1;

            aa = Convert.ToDecimal(dataTable.Rows[0]["FamilyCount"].ToString());
            decimal signAmount    = (aa * (Convert.ToDecimal((param.value.ToString()))));
            string  txtsignAmount = signAmount.ToString("0,0");

            Label5.Text = "مبلغ عضویت: " + txtsignAmount + " ريال ";

            if (dataTable.Rows[0]["Balance"].ToString() != "")
            {
                balanceAmount = (decimal)Convert.ToDouble(dataTable.Rows[0]["Balance"].ToString());
                string balanceString = balanceAmount.ToString("0,0");
                Label4.Text = " " + Label4.Text + balanceString + " ریال ";
            }
            accountId             = Convert.ToDecimal(dataTable.Rows[0]["ID"].ToString());
            hfAccountID.Value     = dataTable.Rows[0]["ID"].ToString();
            hfBalanceAmount.Value = dataTable.Rows[0]["Balance"].ToString();

            btnok.Enabled  = true;
            lblnote.Text   = "";
            txtAmount.Text = "";
        }
Example #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lblName.Text     = " صفحه شخصی " + Session["ClientFirstName"] + " " + Session["ClientLastName"];
            this.Page.Title  = lblName.Text;
            PnlAdmin.Visible = (string)Session["UserName"] == "000";
            AccessDataSource1.SelectCommand =
                "SELECT [Amount], [date], [Description] FROM [payment] where Account_ID=" + Session["AccountId"] +
                " ORDER BY [date] DESC";
            GridView1.Caption      = "ریز پرداختهای مشتری";
            GridView1.CaptionAlign = TableCaptionAlign.Left;
            int count = GridView1.Rows.Count;

            for (int i = 0; i < count; i++)
            {
                try
                {
                    string          a        = GridView1.Rows[i].Cells[0].Text;
                    PersianCalendar pc1      = new PersianCalendar();
                    string          datetime = pc1.GetYear(Convert.ToDateTime(a)) + "/" + pc1.GetMonth(Convert.ToDateTime(a)) + "/" +
                                               pc1.GetDayOfMonth(Convert.ToDateTime(a));
                    GridView1.Rows[i].Cells[0].Text = datetime;
                    decimal balanceString = Convert.ToDecimal(GridView1.Rows[i].Cells[1].Text);
                    GridView1.Rows[i].Cells[1].Text = balanceString.ToString("0,0") + " ريال ";
                }
                catch (Exception err)
                {
                    lblNoteLoan.Text = "مشکل لود ریز پرداختها" + err.Message;
                }
            }
            var    dataTable      = _dataLayerClass.fillClientByClientNumber(Session["UserName"].ToString());
            var    balanceAmount  = (decimal)Convert.ToDouble(dataTable.Rows[0][2].ToString());
            string balanceString1 = balanceAmount.ToString("0,0");

            lblBalance.Text = " " + lblBalance.Text + balanceString1 + " ریال ";
            var     param = _dataLayerClass.getParameterById(1);
            decimal aa    = 1;

            aa = Convert.ToDecimal(dataTable.Rows[0]["FamilyCount"].ToString());
            decimal signAmount    = (aa * (Convert.ToDecimal((param.value.ToString()))));
            string  txtsignAmount = " مبلغ عضویت: " + signAmount.ToString("0,0");

            lblSignAmount.Text = lblSignAmount.Text + txtsignAmount;


            DBLayare.Loan   loanInfo = new Loan();
            Loan.LoanStruct?loanInfoByClientNumber = loanInfo.getLoanInfoByClientNumber((string)Session["UserName"]);
            if (loanInfoByClientNumber != null)
            {
                lblNoteLoan.Visible = false;
                DBLayare.Loan.LoanStruct loanInfoResult = (Loan.LoanStruct)loanInfoByClientNumber;
                lblLoanNumber.Text = "شماره تسهیلات: " + loanInfoResult.loanNumber.ToString();
                lblLoanAmount.Text = "مبلغ تسهیلات: " + loanInfoResult.amount.ToString("0,0");

                PersianCalendar pc1      = new PersianCalendar();
                string          datetime = pc1.GetYear(Convert.ToDateTime(loanInfoResult.grantDate)) + "/" + pc1.GetMonth(Convert.ToDateTime(loanInfoResult.grantDate)) + "/" +
                                           pc1.GetDayOfMonth(Convert.ToDateTime(loanInfoResult.grantDate));
                lblGrantDate.Text    = "تاریخ اعطای تسهیلات: " + datetime.ToString();
                loanDS.SelectCommand = "SELECT InstallmentTable.Installment_Number, InstallmentTable.DUE_DATE, InstallmentTable.Installment_Amount, InstallmentTable.Installment_Status" +
                                       " FROM InstallmentTable WHERE (((InstallmentTable.Loan_ID)=" + loanInfoResult.loanNumber + "))";
            }
            else
            {
                lblNoteLoan.Font.Size = 12;
                lblNoteLoan.Text      = "در حال حاضر تسهیلات اعطا شده ای وجود ندارد";
                lblNoteLoan.Visible   = true;
            }

            for (int i = 0; i < GridView2.Rows.Count; i++)
            {
                try
                {
                    string          a        = GridView2.Rows[i].Cells[1].Text;
                    PersianCalendar pc1      = new PersianCalendar();
                    string          datetime = pc1.GetYear(Convert.ToDateTime(a)) + "/" + pc1.GetMonth(Convert.ToDateTime(a)) + "/" +
                                               pc1.GetDayOfMonth(Convert.ToDateTime(a));
                    GridView2.Rows[i].Cells[1].Text = datetime;
                    decimal balanceString = Convert.ToDecimal(GridView2.Rows[i].Cells[2].Text);
                    GridView2.Rows[i].Cells[2].Text = balanceString.ToString("0,0") + " ريال ";
                    switch (GridView2.Rows[i].Cells[3].Text)
                    {
                    case "0":
                    {
                        GridView2.Rows[i].Cells[3].Text = "پرداخت نشده";
                        break;
                    }

                    case "2":
                    {
                        GridView2.Rows[i].Cells[3].Text = "پرداخت شده";
                        GridView2.Rows[i].BackColor     = System.Drawing.Color.LightCyan;
                        break;
                    }

                    case "1":
                    {
                        GridView2.Rows[i].Cells[3].Text = "سررسید گذشته";
                        GridView2.Rows[i].BackColor     = System.Drawing.Color.LightPink;
                        break;
                    }

                    case "3":
                    {
                        GridView2.Rows[i].Cells[3].Text = "سررسید شده";
                        GridView2.Rows[i].BackColor     = System.Drawing.Color.Beige;
                        break;
                    }
                    }
                }
                catch (Exception)
                {
                }
            }
        }