Exemplo n.º 1
0
    private void FillForm()
    {
        PIKCV.BUS.Credits obj = new PIKCV.BUS.Credits();
        DataTable         dt  = obj.GetCreditDetail(0);

        if (dt.Rows.Count > 0)
        {
            lbCreditMultiplier.Text     = dt.Rows[0]["Multiplier"].ToString();
            this.CreditMultiplier       = Convert.ToDouble(dt.Rows[0]["Multiplier"]);
            lbCredits.Text              = dt.Rows[0]["Credits"].ToString();
            errMinPikCredi.MinimumValue = dt.Rows[0]["Credits"].ToString();
            errMinPikCredi.ErrorMessage = "Lütfen " + errMinPikCredi.MinimumValue + "'den büyük bir tamsayý sayý giriniz.";
            double Price = Convert.ToDouble(dt.Rows[0]["Multiplier"]) * Convert.ToDouble(dt.Rows[0]["Credits"]);
            lbPrice.Text = Price.ToString();
        }
    }
Exemplo n.º 2
0
    private void FillForm()
    {
        PIKCV.BUS.Credits obj      = new PIKCV.BUS.Credits();
        DataTable         dt       = obj.GetCreditDetail(this.CreditPackageTypeID);
        double            Credtits = 0;

        if (this.IsOtherPackage)
        {
            lbCredits.Text = this.OtherPackageCredits.ToString();
            Credtits       = this.OtherPackageCredits * Convert.ToDouble(dt.Rows[0]["Multiplier"]);
            lbPrice.Text   = Credtits.ToString();
        }
        else
        {
            if (dt.Rows.Count > 0)
            {
                lbCredits.Text = dt.Rows[0]["Credits"].ToString();
                Credtits       = Convert.ToInt32(dt.Rows[0]["Credits"]) * Convert.ToDouble(dt.Rows[0]["Multiplier"]);
                lbPrice.Text   = Credtits.ToString();
            }
            else
            {
                this.Redirect("Company-Credits-SelectCreditPackage");
            }
        }

        PIKCV.BUS.Company objCompany = new PIKCV.BUS.Company();
        dt = objCompany.GetCompanyInfo(this.smCompanyID);
        if (dt.Rows.Count > 0)
        {
            if (Convert.ToInt32(dt.Rows[0]["MaxLoan"]) < Convert.ToInt32(lbPrice.Text))
            {
                pnlPaymentTypeLoan.Visible = false;
                rbLoan.Checked             = false;
                rbTransfer.Checked         = true;
                btnSubmit_Click(new object(), null);
            }
        }
        else
        {
            this.Redirect("Company-Credits-SelectCreditPackage");
        }
    }
Exemplo n.º 3
0
    private void FillForm(int CreditPackageID)
    {
        PIKCV.BUS.Credits obj = new PIKCV.BUS.Credits();
        DataTable         dt  = obj.GetCreditPackages();

        foreach (DataRow dr in dt.Rows)
        {
            if (Convert.ToInt32(dr["CreditPackageID"]) == 0)
            {
                dr["CreditPackageName"] = dr["Credits"].ToString() + " " + dr["CreditPackageName"].ToString();
            }
            else
            {
                double Price = Convert.ToDouble(dr["Credits"]) * Convert.ToDouble(dr["Multiplier"]);
                dr["CreditPackageName"] = dr["CreditPackageName"].ToString() + " - " + Price.ToString() + "YTL";
            }
        }
        if (dt.Rows.Count > 0)
        {
            if (Convert.ToInt32(dt.Rows[0]["CreditPackageID"]) == 0)
            {
                DataRow drOtherCredits = dt.NewRow();
                drOtherCredits["CreditPackageName"] = dt.Rows[0]["CreditPackageName"];
                drOtherCredits["CreditPackageID"]   = dt.Rows[0]["CreditPackageID"];
                dt.Rows[0].Delete();
                dt.Rows.Add(drOtherCredits);
            }
        }

        CARETTA.COM.DataBindHelper.BindRadioButtonList(ref rbCreditPackages, dt, "CreditPackageName", "CreditPackageID", "1");
        if (CreditPackageID > 0)
        {
            try
            {
                rbCreditPackages.SelectedValue = CreditPackageID.ToString();
            }
            catch (Exception)
            {
                rbCreditPackages.SelectedValue = "1";
            }
        }
    }
Exemplo n.º 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Util.IsNumeric(Request.QueryString["CreditPackageType"]))
         {
             this.CreditPackageTypeID = Convert.ToInt32(Request.QueryString["CreditPackageType"]);
             if (Util.IsNumeric(Request.QueryString["OtherPackageCredits"]))
             {
                 int MinCredits = 0;
                 this.OtherPackageCredits = Convert.ToInt32(Request.QueryString["OtherPackageCredits"]);
                 PIKCV.BUS.Credits obj = new PIKCV.BUS.Credits();
                 DataTable         dt  = obj.GetCreditDetail(0);
                 if (dt.Rows.Count > 0)
                 {
                     MinCredits = Convert.ToInt32(dt.Rows[0]["Credits"]);
                     this.OtherPackageMultiplier = Convert.ToDouble(dt.Rows[0]["Multiplier"]);
                 }
                 if (this.OtherPackageCredits >= MinCredits)
                 {
                     this.IsOtherPackage = true;
                 }
                 else
                 {
                     this.Redirect("Company-Credits-SelectCreditPackage");
                 }
             }
             else
             {
                 this.IsOtherPackage = false;
             }
             FillForm();
         }
         else
         {
             this.Redirect("Company-Credits-SelectCreditPackage");
         }
     }
 }
Exemplo n.º 5
0
    private void MakePayment(PIKCV.COM.EnumDB.PaymentType PaymentType)
    {
        PIKCV.BUS.Credits obj  = new PIKCV.BUS.Credits();
        int SavedCreditOrderID = 0;

        if (this.IsOtherPackage)
        {
            SavedCreditOrderID = obj.InsertCreditOrders(this.smCompanyID, this.CreditPackageTypeID, 0, 0, this.OtherPackageCredits, this.OtherPackageMultiplier, PIKCV.COM.EnumDB.OrderTypeCode.CreditBuy, PaymentType, this.IsOtherPackage);
        }
        else
        {
            DataTable dt = obj.GetCreditDetail(this.CreditPackageTypeID);
            if (dt.Rows.Count > 0)
            {
                SavedCreditOrderID = obj.InsertCreditOrders(this.smCompanyID, this.CreditPackageTypeID, Convert.ToInt32(dt.Rows[0]["Credits"]), Convert.ToInt32(dt.Rows[0]["Multiplier"]), 0, 0, PIKCV.COM.EnumDB.OrderTypeCode.CreditBuy, PaymentType, this.IsOtherPackage);
            }
            else
            {
                this.Redirect("Company-Credits-SelectCreditPackage");
            }
        }
        if (SavedCreditOrderID > 0)
        {
            DataTable dt = obj.GetCreditOrderDetail(SavedCreditOrderID);
            if (dt.Rows.Count > 0)
            {
                double TotalAmount = 0;
                if (this.IsOtherPackage)
                {
                    lbApprovalCreditPackageName.Text = "Pik Kredi Alýmý (" + dt.Rows[0]["OtherPackageQuantity"].ToString() + ")";
                    TotalAmount          = Convert.ToInt32(dt.Rows[0]["OtherPackageQuantity"]) * Convert.ToDouble(dt.Rows[0]["OtherPackagePrice"]);
                    lbApprovalPrice.Text = TotalAmount.ToString() + " YTL";
                }
                else
                {
                    lbApprovalCreditPackageName.Text = "Pik Kredi Alýmý (" + dt.Rows[0]["Quantity"].ToString() + ")";
                    TotalAmount          = Convert.ToInt32(dt.Rows[0]["Quantity"]) * Convert.ToDouble(dt.Rows[0]["ItemPrice"]);
                    lbApprovalPrice.Text = TotalAmount.ToString() + " YTL";
                }
                lbOrderDate.Text = string.Format("{0:d}", dt.Rows[0]["OrderDate"]);
                lbOrderType.Text = ((PIKCV.COM.EnumDB.PaymentType)(Convert.ToInt32(dt.Rows[0]["PaymentType"]))).ToString();
            }
            if (PaymentType == PIKCV.COM.EnumDB.PaymentType.Transfer)
            {
                lbApprovalMessage.Text = "Talebiniz alýndý, ödeme sonrasýnda sitemizde iþlem yapabileceksiniz.";
            }
            else
            {
                dvMsg.Visible = false;
            }
        }
        else
        {
            lbApprovalMessage.Text = "Kayýt sýrasýnda bir hata oluþtu. Lütfen tekrar deneyin.";
        }
        pnlHeader.Visible   = false;
        pnlApproval.Visible = true;

        PIKCV.BUS.Company objCompany = new PIKCV.BUS.Company();
        this.smPikCredi = objCompany.GetCompanyInfo(this.smCompanyID).Rows[0]["Credits"].ToString();


        if (this.smRememberURL != String.Empty)
        {
            string strUrl = this.smRememberURL;
            this.smRememberURL = String.Empty;
            Response.Redirect(strUrl);
        }
    }