Exemple #1
0
        void SubmitCode()
        {
            try
            {
                string Message = ""; long?InvoiceNumber = 0;
                hdfapp.Value = Convert.ToString(Request.QueryString["EmiMode"]);
                switch (hdfapp.Value)
                {
                case "Monthly":

                    #region Inserting Data Into Payment Table

                    da.spUpdatePayment(Convert.ToInt32(Session["id"]), Convert.ToInt32(Request.QueryString["EmiModeId"]), Convert.ToDecimal(txttotalamt.Value), Convert.ToDecimal(txtpaidamt.Text), Convert.ToDecimal(txtdueamt.Value), Convert.ToDecimal(txtextrachrge.Value), 1, DateTime.Now.AddMonths(1), DateTime.Now.Date, ref Message);

                    #endregion

                    #region Inserting Data Into Payment History Table

                    da.spPaymentHistory(Convert.ToInt32(Session["id"]), Convert.ToInt32(Request.QueryString["EmiModeId"]), Convert.ToDecimal(txttotalamt.Value), Convert.ToDecimal(txtpaidamt.Text), Convert.ToDecimal(txtdueamt.Value), Convert.ToDecimal(txtextrachrge.Value), 1, DateTime.Now.AddMonths(1), DateTime.Now.Date,
                                        ref InvoiceNumber);

                    #endregion

                    #region Inserting Data into Payment Mode

                    da.spPaymentMode(Convert.ToInt32(Session["id"]), Convert.ToInt32(ddlmode.SelectedValue), txtbnk.Value = txtbnk.Value == "" ? "NA" : txtbnk.Value, txtbnkbrnch.Value = txtbnkbrnch.Value == "" ? "NA" : txtbnkbrnch.Value, Convert.ToInt32(txtcheque.Value), Convert.ToInt32(txtdemand.Value), txttransaction.Value, Convert.ToInt32(Request.QueryString["EmiModeId"]));

                    #endregion

                    #region Update Booking Status
                    objedit.UpdateFlatIdStatus(Convert.ToInt32(Request.QueryString["FlatId"]));
                    #endregion

                    #region Display Message

                    lblmsg.Text = "Booking Completed with reference to bill number " + Convert.ToString(InvoiceNumber);

                    #endregion

                    break;

                case "Two-Month":

                    #region Inserting Data Into Payment Table

                    da.spUpdatePayment(Convert.ToInt32(Session["id"]), Convert.ToInt32(Request.QueryString["EmiModeId"]), Convert.ToDecimal(txttotalamt.Value), Convert.ToDecimal(txtpaidamt.Text), Convert.ToDecimal(txtdueamt.Value), Convert.ToDecimal(txtextrachrge.Value), 1, DateTime.Now.AddMonths(2), DateTime.Now.Date, ref Message);

                    #endregion

                    #region Inserting Data Into Payment History Table

                    da.spPaymentHistory(Convert.ToInt32(Session["id"]), Convert.ToInt32(Request.QueryString["EmiModeId"]), Convert.ToDecimal(txttotalamt.Value), Convert.ToDecimal(txtpaidamt.Text), Convert.ToDecimal(txtdueamt.Value), Convert.ToDecimal(txtextrachrge.Value), 1, DateTime.Now.AddMonths(2), DateTime.Now.Date,
                                        ref InvoiceNumber);

                    #endregion

                    #region Inserting Data into Payment Mode

                    da.spPaymentMode(Convert.ToInt32(Session["id"]), Convert.ToInt32(ddlmode.SelectedValue), txtbnk.Value = txtbnk.Value == "" ? "NA" : txtbnk.Value, txtbnkbrnch.Value = txtbnkbrnch.Value == "" ? "NA" : txtbnkbrnch.Value, Convert.ToInt32(txtcheque.Value), Convert.ToInt32(txtdemand.Value), txttransaction.Value, Convert.ToInt32(Request.QueryString["EmiModeId"]));

                    #endregion

                    #region Update Booking Status
                    objedit.UpdateFlatIdStatus(Convert.ToInt32(Request.QueryString["FlatId"]));
                    #endregion

                    #region Display Message

                    lblmsg.Text = "Booking Completed with reference to bill number " + Convert.ToString(InvoiceNumber);

                    #endregion

                    break;

                case "Quarterly":

                    #region Inserting Data Into Payment Table

                    da.spUpdatePayment(Convert.ToInt32(Session["id"]), Convert.ToInt32(Request.QueryString["EmiModeId"]), Convert.ToDecimal(txttotalamt.Value), Convert.ToDecimal(txtpaidamt.Text), Convert.ToDecimal(txtdueamt.Value), Convert.ToDecimal(txtextrachrge.Value), 1, DateTime.Now.AddMonths(3), DateTime.Now.Date, ref Message);

                    #endregion

                    #region Inserting Data Into Payment History Table

                    da.spPaymentHistory(Convert.ToInt32(Session["id"]), Convert.ToInt32(Request.QueryString["EmiModeId"]), Convert.ToDecimal(txttotalamt.Value), Convert.ToDecimal(txtpaidamt.Text), Convert.ToDecimal(txtdueamt.Value), Convert.ToDecimal(txtextrachrge.Value), 1, DateTime.Now.AddMonths(3), DateTime.Now.Date,
                                        ref InvoiceNumber);

                    #endregion

                    #region Inserting Data into Payment Mode

                    da.spPaymentMode(Convert.ToInt32(Session["id"]), Convert.ToInt32(ddlmode.SelectedValue), txtbnk.Value = txtbnk.Value == "" ? "NA" : txtbnk.Value, txtbnkbrnch.Value = txtbnkbrnch.Value == "" ? "NA" : txtbnkbrnch.Value, Convert.ToInt32(txtcheque.Value), Convert.ToInt32(txtdemand.Value), txttransaction.Value, Convert.ToInt32(Request.QueryString["EmiModeId"]));

                    #endregion

                    #region Update Booking Status
                    objedit.UpdateFlatIdStatus(Convert.ToInt32(Request.QueryString["FlatId"]));
                    #endregion

                    #region Display Message

                    lblmsg.Text = "Booking Completed with reference to bill number " + Convert.ToString(InvoiceNumber);

                    #endregion

                    break;

                case "Half-Yearly":

                    #region Inserting Data Into Payment Table

                    da.spUpdatePayment(Convert.ToInt32(Session["id"]), Convert.ToInt32(Request.QueryString["EmiModeId"]), Convert.ToDecimal(txttotalamt.Value), Convert.ToDecimal(txtpaidamt.Text), Convert.ToDecimal(txtdueamt.Value), Convert.ToDecimal(txtextrachrge.Value), 1, DateTime.Now.AddMonths(6), DateTime.Now.Date, ref Message);

                    #endregion

                    #region Inserting Data Into Payment History Table

                    da.spPaymentHistory(Convert.ToInt32(Session["id"]), Convert.ToInt32(Request.QueryString["EmiModeId"]), Convert.ToDecimal(txttotalamt.Value), Convert.ToDecimal(txtpaidamt.Text), Convert.ToDecimal(txtdueamt.Value), Convert.ToDecimal(txtextrachrge.Value), 1, DateTime.Now.AddMonths(6), DateTime.Now.Date,
                                        ref InvoiceNumber);

                    #endregion

                    #region Inserting Data into Payment Mode

                    da.spPaymentMode(Convert.ToInt32(Session["id"]), Convert.ToInt32(ddlmode.SelectedValue), txtbnk.Value = txtbnk.Value == "" ? "NA" : txtbnk.Value, txtbnkbrnch.Value = txtbnkbrnch.Value == "" ? "NA" : txtbnkbrnch.Value, Convert.ToInt32(txtcheque.Value), Convert.ToInt32(txtdemand.Value), txttransaction.Value, Convert.ToInt32(Request.QueryString["EmiModeId"]));

                    #endregion

                    #region Update Booking Status
                    objedit.UpdateFlatIdStatus(Convert.ToInt32(Request.QueryString["FlatId"]));
                    #endregion

                    #region Display Message

                    lblmsg.Text = "Booking Completed with reference to bill number " + Convert.ToString(InvoiceNumber);

                    #endregion

                    break;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }