コード例 #1
0
    public void BindCustomerAccountType()
    {
        int intUserId = int.Parse(Session["UserId"].ToString());

        try
        {
            DALCutomerAccountType objCustomerAccountType = new DALCutomerAccountType();
            DataSet dsCustomerAccountType = new DataSet();
            dsCustomerAccountType = objCustomerAccountType.SelectAll(intUserId);

            if (dsCustomerAccountType.Tables[0].Rows.Count > 0)
            {
                ddlCutomerAccounttype.DataSource     = dsCustomerAccountType.Tables[0];
                ddlCutomerAccounttype.DataTextField  = "cAccountType";
                ddlCutomerAccounttype.DataValueField = "nCutomerAccountTypeId";
                ddlCutomerAccounttype.DataBind();
                ddlCutomerAccounttype.Items.Insert(0, "Customer Account type");
            }
            else
            {
            }
            //int intLastItem = int.Parse(ddlCustomer.Items.Count.ToString());
            //ddlCustomer.Items.Insert(intLastItem, "Add Customer");
        }
        catch (Exception ex)
        {
            DALExceptionDetail objDALExceptionDetail = new DALExceptionDetail();
            objDALExceptionDetail.InsertRow(ex.Message, "RefundToCustomer.aspx", intUserId, DateTime.Now, true);
        }
    }
コード例 #2
0
 protected void dgAppoinments_DeleteCommand(object source, DataGridCommandEventArgs e)
 {
     try
     {
         Label lblnAppointmentId = (Label)e.Item.FindControl("lblnAppointmentId");
         DALmstAppointmentManagement objDALmstAppointmentManagement = new DALmstAppointmentManagement();
         int intId     = int.Parse(lblnAppointmentId.Text);
         int intUserId = int.Parse(Session["UserId"].ToString());
         objDALmstAppointmentManagement.DeleteRow(intId, intUserId);
         BindAllAppoinments();
     }
     catch (Exception ex)
     {
         string             strMessage            = ex.Message;
         int                intUserId             = int.Parse(Session["UserId"].ToString());
         DALExceptionDetail objDALExceptionDetail = new DALExceptionDetail();
         objDALExceptionDetail.InsertRow(strMessage, "Appointment.aspx", intUserId, DateTime.Now, true);
     }
 }
コード例 #3
0
    protected void btnSaveProduct_Click(object sender, EventArgs e)
    {
        int intUserId = int.Parse(Session["UserId"].ToString());

        try
        {
            DALmstOrder        objDALmstOrder          = new DALmstOrder();
            DALmstRefundAmount objDALmstRefundAmount   = new DALmstRefundAmount();
            DataSet            dsobjDALmstRefundAmount = new DataSet();

            if (txtRefundAmount.Text != "0")
            {
                int      nOrderId              = int.Parse(Request.QueryString["OrderId"].ToString());
                int      nCustomerId           = int.Parse(lblId.Text);
                int      nLanguageId           = 1;
                DateTime dtPaymentReceived     = DateTime.Parse(txtPaymentDueDate.Text);
                float    fRefundAmount         = float.Parse(txtRefundAmount.Text);
                int      nCutomerAccountTypeId = int.Parse(ddlCutomerAccounttype.SelectedValue);
                string   cReferenceNumber      = txtReferencenumber.Text;
                string   cNotes = txtNotes.Text;

                float TotalAmount = float.Parse(lblTotal.Text);
                if (fRefundAmount == TotalAmount)
                {
                    objDALmstOrder.UpdateStatusAfterTakePayment(nOrderId, intUserId, "Return", dtPaymentReceived);


                    objDALmstRefundAmount.InsertRow(nOrderId, nCustomerId, dtPaymentReceived, fRefundAmount, nCutomerAccountTypeId, cReferenceNumber, cNotes, intUserId, true, nLanguageId, false, "", "", "", "");

                    #region //START: Enter Log


                    string strchatUserNAme = Session["ChatUsername"].ToString();

                    string strCustomerName = "";

                    DALCustomer objCustomer = new DALCustomer();
                    DataSet     dsCustomer  = new DataSet();
                    dsCustomer = objCustomer.SelectRow(nCustomerId, intUserId);
                    if (dsCustomer.Tables[0].Rows.Count > 0)
                    {
                        strCustomerName = dsCustomer.Tables[0].Rows[0]["cCustomerFirstName"].ToString() + " " + dsCustomer.Tables[0].Rows[0]["cCustomerLastName"].ToString();
                    }

                    string    strDescription = "Refund payment for 'CN'" + nOrderId + "(" + strCustomerName + ")";
                    DALmstLog objLog         = new DALmstLog();
                    objLog.InsertRow(cReferenceNumber, strDescription, "insert", strchatUserNAme, DateTime.Now, intUserId, 0, true, false, "", "", "");

                    strDescription = "Full Refund payment for 'CN'" + nOrderId + "(" + strCustomerName + ")";

                    objLog.InsertRow(cReferenceNumber, strDescription, "insert", strchatUserNAme, DateTime.Now, intUserId, 0, true, false, "", "", "");

                    #endregion

                    Response.Redirect("ViewInvoice.aspx?PageId=0");
                }
                else if (fRefundAmount > TotalAmount)
                {
                    string strTitleN       = "Take Payment";
                    string strdescriptions = "The amount cannot be more than the credit available to the customer.";
                    NotificationMessage1.NotificationDetails(strTitleN, strdescriptions);
                }
                else
                {
                    objDALmstRefundAmount.InsertRow(nOrderId, nCustomerId, dtPaymentReceived, fRefundAmount, nCutomerAccountTypeId, cReferenceNumber, cNotes, intUserId, true, nLanguageId, false, "", "", "", "");

                    #region //START: Enter Log


                    string strchatUserNAme = Session["ChatUsername"].ToString();

                    string strCustomerName = "";

                    DALCustomer objCustomer = new DALCustomer();
                    DataSet     dsCustomer  = new DataSet();
                    dsCustomer = objCustomer.SelectRow(nCustomerId, intUserId);
                    if (dsCustomer.Tables[0].Rows.Count > 0)
                    {
                        strCustomerName = dsCustomer.Tables[0].Rows[0]["cCustomerFirstName"].ToString() + " " + dsCustomer.Tables[0].Rows[0]["cCustomerLastName"].ToString();
                    }

                    string    strDescription = "Refund amount for 'CN'" + nOrderId + "(" + strCustomerName + ")";
                    DALmstLog objLog         = new DALmstLog();
                    objLog.InsertRow(cReferenceNumber, strDescription, "insert", strchatUserNAme, DateTime.Now, intUserId, 0, true, false, "", "", "");


                    #endregion

                    Response.Redirect("ViewInvoice.aspx?PageId=0");
                }
            }


            else
            {
                string strTitleN       = "";
                string strdescriptions = "The Amount field cannot be $0.00. Please enter an amount other than zero.";
                NotificationMessage1.NotificationDetails(strTitleN, strdescriptions);
            }
        }
        catch (Exception ex)
        {
            DALExceptionDetail objDALExceptionDetail = new DALExceptionDetail();
            objDALExceptionDetail.InsertRow(ex.Message, "RefundToCustomer.aspx", intUserId, DateTime.Now, true);
        }
    }