Beispiel #1
0
    protected void btnOk_Click(object sender, EventArgs e)
    {
        bool result = TRANSManager.UpdateTRANSByLocationID(selecetedGridRow(), selecetedSearchGridRow());

        ModalPopupExtender1.Hide();
        LoadAllLocation();
    }
Beispiel #2
0
    protected void btnOk_Click(object sender, EventArgs e)
    {
        bool result = TRANSManager.UpdateTRANSByAgentID(selecetedGridRow(), selecetedSearchGridRow());

        ModalPopupExtender1.Hide();
        showUserInfoGrid();
    }
    protected void btnIsPending_Click(object sender, EventArgs e)
    {
        divPayment.Visible = true;

        Button linkButton = new Button();

        linkButton = (Button)sender;
        int tRANSID;

        tRANSID = Convert.ToInt32(linkButton.CommandArgument);

        TRANS tRANS = TRANSManager.GetTRANSByID(tRANSID);

        txtTestAnswer.Text   = tRANS.TESTANSWER;
        txtTestQuestion.Text = tRANS.TESTQUESTION;

        hfTransID.Value = tRANS.TRANSID.ToString();

        txtMemberID.Text    = tRANS.RECEIVERID.ToString();
        txtMemberID.Enabled = false;

        //Load Transfer info
        lblTransavtionAmount.Text       = tRANS.TRANSAMOUNT.ToString();
        hfCauseOtherServiceChages.Value = tRANS.CAUSETRANSOTHERFEES;
        lblREFCODE.Text     = tRANS.REFCODE.ToString();
        lblFees.Text        = tRANS.TRANSFEES.ToString();
        lblOtherFees.Text   = tRANS.TRANSOTHERFEES.ToString();
        lblDiscount.Text    = tRANS.TRANSPROMOCODE.ToString();
        lblTotalAmount.Text = tRANS.TRANSTOTALAMOUNT.ToString();

        cleanElements();
        List <RECEIVER> receivers = new List <RECEIVER>();

        receivers = searchMemberInfo();

        txtAddress.Text       = receivers[0].RECEIVERADDRESS1;
        txtRECEIVERFNAME.Text = receivers[0].RECEIVERFNAME;
        txtRECEIVERMNAME.Text = receivers[0].RECEIVERMNAME;
        txtRECEIVERLNAME.Text = receivers[0].RECEIVERLNAME;
        txtCity.Text          = receivers[0].RECEIVERCITY;
        txtPhoneNumber.Text   = receivers[0].RECEIVERPHONE;
        txtState.Text         = receivers[0].RECEIVERSTATE;
        txtZIP.Text           = receivers[0].RECEIVERZIP;

        CUSTOMER cUSTOMER = new CUSTOMER();

        cUSTOMER = CUSTOMERManager.GetCUSTOMERByID(tRANS.CUSTID);

        if (cUSTOMER != null)
        {
            txtCUSName.Text        = cUSTOMER.CUSTFNAME.ToString() + " " + cUSTOMER.CUSTMNAME.ToString() + " " + cUSTOMER.CUSTLNAME.ToString();
            txtCUSAddress1.Text    = cUSTOMER.CUSTADDRESS1.ToString();
            txtCUSAddress2.Text    = cUSTOMER.CUSTADDRESS2.ToString();
            txtCUSCity.Text        = cUSTOMER.CUSTCITY.ToString();
            txtCUSState.Text       = cUSTOMER.CUSTSTATE.ToString();
            txtCUSZIP.Text         = cUSTOMER.CUSTZIP.ToString();
            txtCUSPhoneNumber.Text = cUSTOMER.CUSTWPHONE.ToString();
        }
    }
Beispiel #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         gvTRANS.DataSource = TRANSManager.GetAllTRANSsByTRANSDT_CUSTOMER(780, DateTime.Parse("16/01/2009"));
         gvTRANS.DataBind();
     }
 }
Beispiel #5
0
    private void showTRANSData(string refCode)
    {
        TRANS tRANS = new TRANS();

        if (Request.QueryString["TRANSID"] != null)
        {
            tRANS = TRANSManager.GetTRANSByID(int.Parse(Request.QueryString["TRANSID"]));
        }
        else
        {
            tRANS = TRANSManager.GetTRANSByRefCode(refCode);
        }


        if (tRANS == null)
        {
            panData.Visible   = false;
            panSearch.Visible = true;
        }
        else
        {
            panData.Visible   = true;
            panSearch.Visible = true;

            int senderID   = 0;
            int receiverID = 0;
            int locationID = 0;

            senderID   = tRANS.CUSTID;
            receiverID = tRANS.RECEIVERID;
            locationID = tRANS.LOCATIONID;



            loadSenderInfo(senderID);
            loadReceiverInfo(receiverID);
            loadLocationInfo(locationID);


            txtDate.Text                     = tRANS.TRANSDT.ToShortDateString();
            txtReferenceCode.Text            = tRANS.REFCODE;
            hfReferenceCode.Value            = tRANS.REFCODE;
            txtSendingAmount.Text            = tRANS.TRANSAMOUNT.ToString();
            txtServiceCharge.Text            = tRANS.TRANSFEES.ToString();
            txtOtherServiceCharge.Text       = tRANS.TRANSOTHERFEES.ToString();
            txtCauseOtherServiceCharges.Text = tRANS.CAUSETRANSOTHERFEES.ToString();
            txtDiscount.Text                 = tRANS.TRANSPROMOCODE.ToString();
            txtTotalCharge.Text              = tRANS.TRANSTOTALAMOUNT.ToString();

            txtTestQuestion.Text = tRANS.TESTQUESTION.ToString();
            txtTestAnswer.Text   = tRANS.TESTANSWER.ToString();
            lblStatus.Text       = tRANS.TRANSSTATUS == "VOID" ? "Deleted" : tRANS.TRANSSTATUS.ToString();
            lblStatus.ForeColor  = tRANS.TRANSSTATUS == "PAID" ? System.Drawing.Color.Green : System.Drawing.Color.Red;
            calculateTotal();
        }
    }
    protected void btnOk_Click(object sender, EventArgs e)
    {
        //lblPreviousID.Text = selecetedGridRow().ToString();
        //lblNewID.Text = selecetedSearchGridRow().ToString();


        bool result = TRANSManager.UpdateTRANSByCustomerID(selecetedGridRow(), selecetedSearchGridRow());

        ModalPopupExtender1.Hide();

        searchMemberInfo();
    }
Beispiel #7
0
    protected void gvCustomer_RowDataBound(Object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            Label lblCUSTID   = (Label)e.Row.FindControl("lblCUSTID");
            Label lblTRANSDT  = (Label)e.Row.FindControl("lblTRANSDT");
            Label lblCUSTNAME = (Label)e.Row.FindControl("lblCUSTNAME");
            Label lblReceiver = (Label)e.Row.FindControl("lblReceiver");
            Label lblLocation = (Label)e.Row.FindControl("lblLocation");

            Label lblRECEIVERID = (Label)e.Row.FindControl("lblRECEIVERID");
            Label lblLOCATIONID = (Label)e.Row.FindControl("lblLOCATIONID");



            CUSTOMER cUSTOMER = new CUSTOMER();
            cUSTOMER = CUSTOMERManager.GetCUSTOMERByID(int.Parse(lblCUSTID.Text));


            if (cUSTOMER != null)
            {
                lblCUSTNAME.Text = cUSTOMER.CUSTFNAME + " " + cUSTOMER.CUSTMNAME + " " + cUSTOMER.CUSTLNAME;
            }


            //RECEIVER rECEIVER = new RECEIVER();
            //rECEIVER = RECEIVERManager.GetRECEIVERByID(int.Parse(lblRECEIVERID.Text));

            //if (rECEIVER != null)
            //{
            //    lblReceiver.Text = rECEIVER.RECEIVERFNAME.ToString();
            //}

            //LOCATION lOCATION = new LOCATION();
            //lOCATION = LOCATIONManager.GetLOCATIONByID(int.Parse(lblLOCATIONID.Text));

            //if (lOCATION != null)
            //{
            //    lblLocation.Text = lOCATION.BRANCH.ToString();
            //}



            GridView gvTRANS = (GridView)e.Row.FindControl("gvTRANS");

            gvTRANS.DataSource = TRANSManager.GetAllTRANSsByTRANSDT_CUSTOMER(int.Parse(lblCUSTID.Text), DateTime.Parse(lblTRANSDT.Text));
            gvTRANS.DataBind();
        }
    }
Beispiel #8
0
    protected void btnFullPayment_Click(object sender, EventArgs e)
    {
        TRANS tRANS = new TRANS();

        tRANS = TRANSManager.GetTRANSByRefCode(txtReferenceCode.Text);

        TRANS tempTRANS = new TRANS();

        tempTRANS = tRANS;

        tempTRANS.TRANSSTATUS = "PAID";

        tempTRANS.TRANSRECEIVEDATE   = DateTime.Now;
        tempTRANS.SENDEREMAILADDRESS = txtReceiverEmail.Text;
        tempTRANS.UPDATEDBY          = int.Parse(Session["userInfoID"].ToString());//Session["lOCATION"] != null ? ((LOCATIONGROUP)Session["lOCATION"]).LOCATIONGROUPID : ((AGENT)Session["aGENT"]).AGENTID;
        tempTRANS.UPDATEDON          = DateTime.Now;
        if (TRANSManager.UpdateTRANS_Paid(tempTRANS))
        {
            lblMessage.Text      = "Paid Successfully";
            lblMessage.ForeColor = System.Drawing.Color.Green;
            showTRANSData(txtReferenceCode.Text);
        }
    }
Beispiel #9
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        string senderID   = loadSenderID();
        string receiverID = loadReceiverID();

        string locationID = ddlLocationID.SelectedValue;

        if (
            senderID == "" ||
            senderID == null ||
            receiverID == "" ||
            receiverID == null ||
            locationID == "0" ||
            lblReferenceCode.Text == ""
            )
        {
            lblmessage.Text = "Incorrect Data";
            return;
        }
        else
        if (checkRefCodeDuplicate())
        {
            lblmessage.Text = "Code Duplicate";
            return;
        }
        else
        {
            TRANS tRANS = new TRANS();

            tRANS.CUSTID              = int.Parse(senderID);
            tRANS.RECEIVERID          = int.Parse(receiverID);
            tRANS.LOCATIONID          = int.Parse(locationID);;
            tRANS.TRANSDT             = DateTime.Parse(txtDate.Text);
            tRANS.TRANSAMOUNT         = decimal.Parse(txtSendingAmount.Text);
            tRANS.TRANSFEES           = decimal.Parse(txtServiceCharge.Text);
            tRANS.TRANSOTHERFEES      = decimal.Parse(txtOtherServiceCharge.Text);
            tRANS.CAUSETRANSOTHERFEES = txtCauseOtherServiceCharges.Text;
            tRANS.TRANSPROMOCODE      = txtDiscount.Text;
            tRANS.TRANSPROMO          = 0;
            tRANS.TRANSTOTALAMOUNT    = decimal.Parse(txtTotalCharge.Text);
            tRANS.FLAG_SM_RECEIVER    = 'N';
            tRANS.SM_RECEIVER         = "";
            tRANS.FLAG_CALL_RECEIVER  = 'N';
            tRANS.RECEIVERPHONENO     = "";
            tRANS.FLAG_DD             = 'N';
            tRANS.FLAG_TESTQUESTION   = 'N';
            tRANS.TESTQUESTION        = txtTestQuestion.Text;
            tRANS.TESTANSWER          = txtTestAnswer.Text;
            tRANS.FLAG_CALLSENDER     = 'N';
            tRANS.FLAG_SMSSENDER      = 'N';
            tRANS.FLAG_EMAILSENDER    = 'N';
            tRANS.SENDEREMAILADDRESS  = "";
            tRANS.TRANSSTATUS         = "PENDING";
            tRANS.TRANSRECEIVEDID     = "";
            tRANS.TRANSRECEIVEDATE    = DateTime.Now;
            tRANS.CREATEDBY           = 1;
            tRANS.CREATEDON           = DateTime.Now;
            tRANS.UPDATEDBY           = 1;
            tRANS.UPDATEDON           = DateTime.Now;
            tRANS.AGENTID             = 4;
            tRANS.REFCODE             = lblReferenceCode.Text;

            lblmessage.Text = "Successfull Transfer Code: <a href='EditPayment.aspx?TRANSID=" + TRANSManager.InsertTRANS(tRANS) + "' target='_blank'>" + lblReferenceCode.Text + @"</a>";
            txtName.Focus();
            txtName.Text                = "";
            txtReceiverName.Text        = "";
            txtSendingAmount.Text       = "0";
            txtServiceCharge.Text       = "0";
            txtTotalCharge.Text         = "0";
            lblReferenceCode.Text       = "";
            ddlLocationID.SelectedValue = "0";
        }
    }
Beispiel #10
0
    protected void gvLocation_RowDataBound(Object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            HiddenField hfLocationID = (HiddenField)e.Row.FindControl("hfLocationID");
            GridView    gvTRANS      = (GridView)e.Row.FindControl("gvTRANS");

            List <TRANS> tRANSs = new List <TRANS>();
            tRANSs = TRANSManager.GetTRANSByAgnetIDnLocationIDByDateNAmountStatus(status, int.Parse(hfLocationID.Value), int.Parse(ddlAgent.SelectedValue), txtFromDate.Text, txtToDate.Text, int.Parse(txtMoney.Text == "" ? "0" : txtMoney.Text));

            decimal sendingAmount = 0;
            decimal fees          = 0;
            decimal discount      = 0;
            decimal Total         = 0;


            foreach (TRANS tRANS in tRANSs)
            {
                if (hfCustomerIDnSUS.Value != "")
                {
                    if (!hfCustomerIDnSUS.Value.Contains(";" + tRANS.CUSTID + "-"))
                    {
                        bool NeedVarification = true;
                        try{
                            if (DateTime.Parse(tRANS.USERNAME) > DateTime.Today)
                            {
                                NeedVarification        = false;
                                hfCustomerIDnSUS.Value += ";" + tRANS.CUSTID + "-N";
                                tRANS.IsSUS             = false;
                                tRANS.IsNotSUS          = !tRANS.IsSUS;
                            }
                        }catch (Exception ex)
                        {
                        }

                        if (NeedVarification)
                        {
                            if (varifySUS(tRANS.CUSTFNAME, tRANS.CUSTMNAME, tRANS.CUSTLNAME) == "Y")
                            {
                                hfCustomerIDnSUS.Value += ";" + tRANS.CUSTID + "-Y";
                                tRANS.IsSUS             = true;
                                tRANS.IsNotSUS          = !tRANS.IsSUS;
                            }
                            else
                            {
                                hfCustomerIDnSUS.Value += ";" + tRANS.CUSTID + "-N";
                                tRANS.IsSUS             = false;
                                tRANS.IsNotSUS          = !tRANS.IsSUS;
                            }
                        }
                    }
                    else
                    {
                        foreach (string item in hfCustomerIDnSUS.Value.Split(';'))
                        {
                            if (item.Contains("-"))
                            {
                                if (item.Split('-')[0] == tRANS.CUSTID.ToString())
                                {
                                    if (item.Split('-')[1] == "Y")
                                    {
                                        tRANS.IsSUS    = true;
                                        tRANS.IsNotSUS = !tRANS.IsSUS;
                                    }
                                    else
                                    {
                                        tRANS.IsSUS    = false;
                                        tRANS.IsNotSUS = !tRANS.IsSUS;
                                    }
                                    break;
                                }
                            }
                        }
                    }
                }
                else
                {
                    if (varifySUS(tRANS.CUSTFNAME, tRANS.CUSTMNAME, tRANS.CUSTLNAME) == "Y")
                    {
                        hfCustomerIDnSUS.Value += ";" + tRANS.CUSTID + "-Y";
                        tRANS.IsSUS             = true;
                        tRANS.IsNotSUS          = !tRANS.IsSUS;
                    }
                    else
                    {
                        hfCustomerIDnSUS.Value += ";" + tRANS.CUSTID + "-N";
                        tRANS.IsSUS             = false;
                        tRANS.IsNotSUS          = !tRANS.IsSUS;
                    }
                }
            }


            if (chkLoadSUSCustmer.Checked)
            {
                for (int i = 0; i < tRANSs.Count; i++)
                {
                    if (hfCustomerIDnSUS.Value != "")
                    {
                        if (hfCustomerIDnSUS.Value.Contains(";" + tRANSs[i].CUSTID + "-"))
                        {
                            foreach (string item in hfCustomerIDnSUS.Value.Split(';'))
                            {
                                if (item.Contains("-"))
                                {
                                    if (item.Split('-')[0] == tRANSs[i].CUSTID.ToString())
                                    {
                                        if (item.Split('-')[1] == "N")
                                        {
                                            tRANSs.RemoveAt(i);
                                            i--;
                                        }
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
            }

            foreach (TRANS tRANS in tRANSs)
            {
                sendingAmount += tRANS.TRANSAMOUNT;

                fees     += tRANS.TRANSFEES;//+ tRANS.TRANSOTHERFEES; because in the sp we have added already
                discount += decimal.Parse(tRANS.TRANSPROMOCODE);
                Total    += tRANS.TRANSTOTALAMOUNT;

                if (Session["userType"].ToString() != "Location")
                {
                    tRANS.IsPending = false;
                    //if (((AGENT)Session["aGENT"]).AGENTID == 4)//if the admin
                    //{
                    tRANS.IsEdit = true;
                    //}
                    //else
                    //{
                    //    tRANS.IsEdit = false;
                    //}
                }
                else
                {
                    tRANS.IsEdit = false;
                }
            }
            //lblCUSTID.Text = hfCustomerIDnSUS.Value;


            gvTRANS.DataSource = tRANSs;
            gvTRANS.DataBind();



            Label lblSubTotalSendingAmount = (Label)e.Row.FindControl("lblSubTotalSendingAmount");
            Label lblSubTotalFees          = (Label)e.Row.FindControl("lblSubTotalFees");
            Label lblSubTotalDiscount      = (Label)e.Row.FindControl("lblSubTotalDiscount");
            Label lblSubTotalTotalAmount   = (Label)e.Row.FindControl("lblSubTotalTotalAmount");

            lblSubTotalSendingAmount.Text = string.Format("{0:C}", double.Parse(sendingAmount.ToString()));
            lblSubTotalFees.Text          = string.Format("{0:C}", double.Parse(fees.ToString()));
            lblSubTotalDiscount.Text      = string.Format("{0:C}", double.Parse(discount.ToString()));
            lblSubTotalTotalAmount.Text   = string.Format("{0:C}", double.Parse(Total.ToString()));

            lblSubTotalSendingAmountTotal.Text = string.Format("{0}", double.Parse(lblSubTotalSendingAmountTotal.Text) + double.Parse(sendingAmount.ToString()));
            lblSubTotalFeesTotal.Text          = string.Format("{0}", double.Parse(lblSubTotalFeesTotal.Text) + double.Parse(fees.ToString()));
            lblSubTotalDiscountTotal.Text      = string.Format("{0}", double.Parse(lblSubTotalDiscountTotal.Text) + double.Parse(discount.ToString()));
            lblSubTotalTotalAmountTotal.Text   = string.Format("{0}", double.Parse(lblSubTotalTotalAmountTotal.Text) + double.Parse(Total.ToString()));

            lblTotalno.Text = (tRANSs.Count + int.Parse(lblTotalno.Text)).ToString();

            if (Total > 0)
            {
                tblTotal.Visible = true;
            }
        }
    }
    protected void btnSearchByRefCode_Click(object sender, EventArgs e)
    {
        gvLocation.Visible = false;
        tblTotal.Visible   = false;
        gvRECEIVER.Visible = true;

        if (txtRefCodeForSearch.Text == "")
        {
            return;
        }

        TRANS tRANS = TRANSManager.GetTRANSByRefCode(txtRefCodeForSearch.Text);

        if (tRANS == null)
        {
            lblmessage.Text      = "No Trasaction Found for that Ref. Code<br/>Please give correct Ref. Code";
            lblmessage.ForeColor = System.Drawing.Color.Red;

            divListOfAllTransaction.Visible = false;
            tblTotal.Visible   = false;
            divPayment.Visible = false;

            return;
        }
        else
        {
            if (tRANS.TRANSSTATUS != "PENDING")
            {
                lblmessage.Text      = "This trasaction already Paid.<br/>Please give another Ref. Code";
                lblmessage.ForeColor = System.Drawing.Color.Red;

                divListOfAllTransaction.Visible = false;
                tblTotal.Visible   = false;
                divPayment.Visible = false;

                return;
            }
        }

        //Load Transfer info
        lblTransavtionAmount.Text = tRANS.TRANSAMOUNT.ToString();
        lblREFCODE.Text           = txtRefCodeForSearch.Text;
        lblFees.Text        = tRANS.TRANSFEES.ToString();
        lblOtherFees.Text   = tRANS.TRANSOTHERFEES.ToString();
        lblDiscount.Text    = tRANS.TRANSPROMOCODE.ToString();
        lblTotalAmount.Text = tRANS.TRANSTOTALAMOUNT.ToString();


        divPayment.Visible = true;

        int tRANSID;

        tRANSID = tRANS.TRANSID;

        txtTestAnswer.Text   = tRANS.TESTANSWER;
        txtTestQuestion.Text = tRANS.TESTQUESTION;

        hfTransID.Value = tRANS.TRANSID.ToString();

        txtMemberID.Text    = tRANS.RECEIVERID.ToString();
        txtMemberID.Enabled = false;

        cleanElements();
        List <RECEIVER> receivers = new List <RECEIVER>();

        receivers = searchMemberInfo();

        txtAddress.Text       = receivers[0].RECEIVERADDRESS1;
        txtRECEIVERFNAME.Text = receivers[0].RECEIVERFNAME;
        txtRECEIVERMNAME.Text = receivers[0].RECEIVERMNAME;
        txtRECEIVERLNAME.Text = receivers[0].RECEIVERLNAME;
        txtCity.Text          = receivers[0].RECEIVERCITY;
        txtPhoneNumber.Text   = receivers[0].RECEIVERPHONE;
        txtState.Text         = receivers[0].RECEIVERSTATE;
        txtZIP.Text           = receivers[0].RECEIVERZIP;
    }
    protected void gvLocation_RowDataBound(Object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            HiddenField hfLocationID = (HiddenField)e.Row.FindControl("hfLocationID");
            GridView    gvTRANS      = (GridView)e.Row.FindControl("gvTRANS");

            List <TRANS> tRANSs = new List <TRANS>();
            tRANSs = TRANSManager.GetTRANSByAgnetIDnLocationIDByDateNAmountStatus(status, int.Parse(hfLocationID.Value), int.Parse(ddlAgent.SelectedValue), txtFromDate.Text, txtToDate.Text, int.Parse(txtMoney.Text == "" ? "0" : txtMoney.Text));

            decimal sendingAmount = 0;
            decimal fees          = 0;
            decimal discount      = 0;
            decimal Total         = 0;

            foreach (TRANS tRANS in tRANSs)
            {
                sendingAmount += tRANS.TRANSAMOUNT;

                fees     += tRANS.TRANSFEES;//+ tRANS.TRANSOTHERFEES; because in the sp we have added already
                discount += decimal.Parse(tRANS.TRANSPROMOCODE);
                Total    += tRANS.TRANSTOTALAMOUNT;

                if (Session["userType"].ToString() != "Location")
                {
                    tRANS.IsPending = false;
                    //if (((AGENT)Session["aGENT"]).AGENTID == 4)//if the admin
                    //{
                    tRANS.IsEdit = true;
                    //}
                    //else
                    //{
                    //    tRANS.IsEdit = false;
                    //}
                }
                else
                {
                    tRANS.IsEdit = false;
                }

                if (tRANS.TotalAmountWitinLastTenDays >= decimal.Parse(txtAmountForFindingSUS.Text))
                {
                    tRANS.TotalAmountWitinLastTenDaysText = "<b style='color:red;'>" + tRANS.TotalAmountWitinLastTenDays.ToString("0,0.00") + "</b>";
                }
                else
                {
                    tRANS.TotalAmountWitinLastTenDaysText = "<b style='color:Green;'>" + tRANS.TotalAmountWitinLastTenDays.ToString("0,0.00") + "</b>";
                }
            }

            gvTRANS.DataSource = tRANSs;
            gvTRANS.DataBind();



            Label lblSubTotalSendingAmount = (Label)e.Row.FindControl("lblSubTotalSendingAmount");
            Label lblSubTotalFees          = (Label)e.Row.FindControl("lblSubTotalFees");
            Label lblSubTotalDiscount      = (Label)e.Row.FindControl("lblSubTotalDiscount");
            Label lblSubTotalTotalAmount   = (Label)e.Row.FindControl("lblSubTotalTotalAmount");

            lblSubTotalSendingAmount.Text = string.Format("{0:C}", double.Parse(sendingAmount.ToString()));
            lblSubTotalFees.Text          = string.Format("{0:C}", double.Parse(fees.ToString()));
            lblSubTotalDiscount.Text      = string.Format("{0:C}", double.Parse(discount.ToString()));
            lblSubTotalTotalAmount.Text   = string.Format("{0:C}", double.Parse(Total.ToString()));

            lblSubTotalSendingAmountTotal.Text = string.Format("{0}", double.Parse(lblSubTotalSendingAmountTotal.Text) + double.Parse(sendingAmount.ToString()));
            lblSubTotalFeesTotal.Text          = string.Format("{0}", double.Parse(lblSubTotalFeesTotal.Text) + double.Parse(fees.ToString()));
            lblSubTotalDiscountTotal.Text      = string.Format("{0}", double.Parse(lblSubTotalDiscountTotal.Text) + double.Parse(discount.ToString()));
            lblSubTotalTotalAmountTotal.Text   = string.Format("{0}", double.Parse(lblSubTotalTotalAmountTotal.Text) + double.Parse(Total.ToString()));

            lblTotalno.Text = (tRANSs.Count + int.Parse(lblTotalno.Text)).ToString();

            if (Total > 0)
            {
                tblTotal.Visible = true;
            }
        }
    }
Beispiel #13
0
    private void updateTRANS(string status)
    {
        if (hfReferenceCode.Value == txtReferenceCode.Text)
        {
            int agnetID = 4;
            if (Session["role"].ToString() == "Agent")
            {
                agnetID = ((AGENT)Session["aGENT"]).AGENTID;
            }
            else if (Session["role"].ToString() == "Location")
            {
                agnetID = (-1) * ((LOCATIONGROUP)Session["lOCATION"]).LOCATIONGROUPID;
            }


            calculateTotal();
            DateTime nullDate = DateTime.Parse(ConfigurationManager.AppSettings["NULL_DATE"].ToString());

            TRANS tRANS = new TRANS();
            tRANS = TRANSManager.GetTRANSByRefCode(txtReferenceCode.Text);
            TRANS tempTRANS = new TRANS();
            tempTRANS.TRANSID = tRANS.TRANSID;

            #region Edit Receiver info
            if (!btnEditReceiver.Visible) //it it invisible that means the Receiver is going to be edited
            {
                txtFirstName.Enabled       = true;
                txtMiddleName.Enabled      = true;
                txtLastName.Enabled        = true;
                txtReceiverCity.Enabled    = true;
                txtReceiverCountry.Enabled = true;

                RECEIVER rECEIVER = new RECEIVER();

                rECEIVER.USERNAME         = User.Identity.Name.ToString();
                rECEIVER.RECEIVERFNAME    = txtFirstName.Text;
                rECEIVER.RECEIVERMNAME    = txtMiddleName.Text;
                rECEIVER.RECEIVERLNAME    = txtLastName.Text;
                rECEIVER.RECEIVERADDRESS1 = "";
                rECEIVER.RECEIVERADDRESS2 = "";
                rECEIVER.RECEIVERCITY     = txtReceiverCity.Text;
                rECEIVER.RECEIVERSTATE    = txtReceiverCountry.Text;
                rECEIVER.RECEIVERZIP      = "";
                rECEIVER.RECEIVERPHONE    = "";
                rECEIVER.SCANURL          = "";
                rECEIVER.CREATEDBY        = int.Parse(Session["userInfoID"].ToString());
                rECEIVER.CREATEDON        = DateTime.Now;
                rECEIVER.UPDATEDBY        = int.Parse(Session["userInfoID"].ToString());
                rECEIVER.UPDATEDON        = DateTime.Now;

                rECEIVER.SCANURL = "~/Uploads/Receiver/no_image.jpeg";

                tRANS.RECEIVERID = RECEIVERManager.InsertRECEIVER(rECEIVER);
                editReceiver(false);
            }
            #endregion

            tempTRANS.CUSTID              = tRANS.CUSTID;
            tempTRANS.RECEIVERID          = tRANS.RECEIVERID;
            tempTRANS.LOCATIONID          = tRANS.LOCATIONID;
            tempTRANS.TRANSDT             = DateTime.Parse(txtDate.Text);
            tempTRANS.TRANSAMOUNT         = Decimal.Parse(txtSendingAmount.Text);
            tempTRANS.TRANSFEES           = Decimal.Parse(txtServiceCharge.Text);
            tempTRANS.TRANSOTHERFEES      = Decimal.Parse(txtOtherServiceCharge.Text);
            tempTRANS.CAUSETRANSOTHERFEES = txtCauseOtherServiceCharges.Text;
            tempTRANS.TRANSPROMOCODE      = txtDiscount.Text;
            tempTRANS.TRANSPROMO          = 0;
            tempTRANS.TRANSTOTALAMOUNT    = Decimal.Parse(txtTotalCharge.Text);
            tempTRANS.FLAG_SM_RECEIVER    = 'N';
            tempTRANS.SM_RECEIVER         = "";
            tempTRANS.FLAG_CALL_RECEIVER  = 'N';
            tempTRANS.RECEIVERPHONENO     = tRANS.RECEIVERPHONENO;
            tempTRANS.FLAG_DD             = 'N';
            tempTRANS.FLAG_TESTQUESTION   = 'N';
            tempTRANS.TESTQUESTION        = txtTestQuestion.Text;
            tempTRANS.TESTANSWER          = txtTestAnswer.Text;
            tempTRANS.FLAG_CALLSENDER     = 'N';
            tempTRANS.FLAG_SMSSENDER      = 'N';
            tempTRANS.FLAG_EMAILSENDER    = 'N';
            tempTRANS.SENDEREMAILADDRESS  = "";
            tempTRANS.TRANSSTATUS         = status != "SAME" ? status : tRANS.TRANSSTATUS;
            tempTRANS.TRANSRECEIVEDID     = "";
            tempTRANS.TRANSRECEIVEDATE    = nullDate;
            tempTRANS.CREATEDBY           = tRANS.CREATEDBY;
            tempTRANS.CREATEDON           = tRANS.CREATEDON;
            tempTRANS.UPDATEDBY           = int.Parse(Session["userInfoID"].ToString()); //agnetID; //for location it will be -ve
            tempTRANS.UPDATEDON           = DateTime.Now;
            tempTRANS.AGENTID             = tRANS.AGENTID;
            tempTRANS.REFCODE             = tRANS.REFCODE;
            bool result = TRANSManager.UpdateTRANS(tempTRANS);

            lblMessage.Text      = "Update Successfully";
            lblMessage.ForeColor = System.Drawing.Color.Green;
            //divEditTrans.Visible = false;
        }
        else
        {
            lblMessage.Text      = "Update Error: You should not change the Ref Code.";
            lblMessage.ForeColor = System.Drawing.Color.Red;
        }
    }
Beispiel #14
0
    private void ExportToPDF()
    {
        Document document = new Document(PageSize.A4, 0, 0, 0, 0);

        System.IO.MemoryStream msReport = new System.IO.MemoryStream();

        try
        {
            // creation of the different writers
            PdfWriter writer = PdfWriter.GetInstance(document, msReport);

            // we add some meta information to the document
            document.AddAuthor("Maruf");
            document.AddSubject("Report");

            document.Open();

            iTextSharp.text.Table datatable = new iTextSharp.text.Table(9);

            datatable.Padding = 2;
            datatable.Spacing = 0;

            float[] headerwidths = { 10, 9, 9, 9, 9, 9, 9, 9, 9 };
            datatable.Widths = headerwidths;



            //iTextSharp.text.Table datatable1 = new iTextSharp.text.Table(7);

            //datatable1.Padding = 2;
            //datatable1.Spacing = 0;

            float[] headerwidths1 = { 16, 14, 14, 14, 14, 14, 14 };
            //datatable1.Widths = headerwidths1;


            // the first cell spans 7 columns
            Cell cell = new Cell(new Phrase("Receipt", FontFactory.GetFont(FontFactory.HELVETICA, 16, Font.BOLD)));
            cell.HorizontalAlignment = Element.ALIGN_CENTER;
            cell.Leading             = 30;
            cell.Colspan             = 9;
            cell.Border          = Rectangle.NO_BORDER;
            cell.BackgroundColor = new iTextSharp.text.Color(System.Drawing.Color.Gray);
            datatable.AddCell(cell);

            List <string> ssReferenceCodeFINAL = new List <string>();
            ssReferenceCodeFINAL = (List <string>)Session["ssReferenceCode"];

            string stReferenceCode = string.Empty;

            datatable.DefaultHorizontalAlignment = Element.ALIGN_LEFT;
            TRANS tRANS = new TRANS();
            tRANS = TRANSManager.GetTRANSByRefCode(ssReferenceCodeFINAL[0].ToString());

            if (tRANS != null)
            {
                AGENT agent = new AGENT();

                agent = AGENTManager.GetAGENTByID(tRANS.AGENTID);
                if (agent != null)
                {
                    Cell cell1 = new Cell(new Phrase("Agent No/Location : " + agent.AGENTNAME.ToString(), FontFactory.GetFont(FontFactory.HELVETICA, 10, Font.BOLD)));
                    cell1.HorizontalAlignment = Element.ALIGN_LEFT;
                    //cell1.Leading = 30;
                    cell1.Colspan         = 9;
                    cell1.Border          = Rectangle.BOX;
                    cell1.BorderWidth     = 1;
                    cell1.BackgroundColor = new iTextSharp.text.Color(System.Drawing.Color.WhiteSmoke);
                    datatable.AddCell(cell1);
                }



                Cell cellSender = new Cell(new Phrase("Sender Information  ", FontFactory.GetFont(FontFactory.HELVETICA, 10, Font.BOLD)));
                cellSender.HorizontalAlignment = Element.ALIGN_LEFT;
                cellSender.Colspan             = 9;
                cellSender.Border          = Rectangle.NO_BORDER;
                cellSender.BackgroundColor = new iTextSharp.text.Color(System.Drawing.Color.WhiteSmoke);
                datatable.AddCell(cellSender);


                datatable.DefaultCellBorderWidth     = 1;
                datatable.DefaultHorizontalAlignment = 1;
                datatable.DefaultRowspan             = 9;
                //datatable.Widths = headerwidths;
                //datatable.ta
                datatable.AddCell(new Phrase("First Name", FontFactory.GetFont(FontFactory.HELVETICA, 9, Font.BOLD)));
                datatable.AddCell(new Phrase("Last Name", FontFactory.GetFont(FontFactory.HELVETICA, 9, Font.BOLD)));
                datatable.AddCell(new Phrase("Middle Name", FontFactory.GetFont(FontFactory.HELVETICA, 9, Font.BOLD)));
                datatable.AddCell(new Phrase("Address", FontFactory.GetFont(FontFactory.HELVETICA, 9, Font.BOLD)));
                datatable.AddCell(new Phrase("City", FontFactory.GetFont(FontFactory.HELVETICA, 9, Font.BOLD)));
                datatable.AddCell(new Phrase("State", FontFactory.GetFont(FontFactory.HELVETICA, 9, Font.BOLD)));
                datatable.AddCell(new Phrase("Zip", FontFactory.GetFont(FontFactory.HELVETICA, 9, Font.BOLD)));
                datatable.AddCell(new Phrase("", FontFactory.GetFont(FontFactory.HELVETICA, 9, Font.BOLD)));
                datatable.AddCell(new Phrase("", FontFactory.GetFont(FontFactory.HELVETICA, 9, Font.BOLD)));
                //datatable.AddCell(new Phrase("", FontFactory.GetFont(FontFactory.HELVETICA, 9, Font.BOLD)));
                //datatable.AddCell(new Phrase("", FontFactory.GetFont(FontFactory.HELVETICA, 9, Font.BOLD)));



                datatable.Alignment = Element.ALIGN_CENTER;


                CUSTOMER cUSTOMER = new CUSTOMER();

                cUSTOMER = CUSTOMERManager.GetCUSTOMERByID(int.Parse(tRANS.CUSTID.ToString()));

                if (cUSTOMER != null)
                {
                    datatable.AddCell(cUSTOMER.CUSTFNAME);
                    datatable.AddCell(cUSTOMER.CUSTMNAME);
                    datatable.AddCell(cUSTOMER.CUSTLNAME);
                    datatable.AddCell(cUSTOMER.CUSTADDRESS1);
                    datatable.AddCell(cUSTOMER.CUSTCITY);
                    datatable.AddCell(cUSTOMER.CUSTSTATE);

                    datatable.AddCell(cUSTOMER.CUSTZIP);
                }
                datatable.AddCell("");
                datatable.AddCell("");
                //datatable.AddCell("");
                //datatable.AddCell("");
            }

            //document.Add(datatable1);

            //document.Close();
            Cell cellLocation = new Cell(new Phrase("Location Information  ", FontFactory.GetFont(FontFactory.HELVETICA, 10, Font.BOLD)));
            cellLocation.HorizontalAlignment = Element.ALIGN_LEFT;
            cellLocation.Colspan             = 9;
            cellLocation.Border          = Rectangle.NO_BORDER;
            cellLocation.BackgroundColor = new iTextSharp.text.Color(System.Drawing.Color.WhiteSmoke);
            datatable.AddCell(cellLocation);


            datatable.DefaultCellBorderWidth     = 1;
            datatable.DefaultHorizontalAlignment = 1;
            datatable.DefaultRowspan             = 9;

            datatable.AddCell(new Phrase("Branch", FontFactory.GetFont(FontFactory.HELVETICA, 9, Font.BOLD)));
            datatable.AddCell(new Phrase("City", FontFactory.GetFont(FontFactory.HELVETICA, 9, Font.BOLD)));
            datatable.AddCell(new Phrase("Country", FontFactory.GetFont(FontFactory.HELVETICA, 9, Font.BOLD)));
            datatable.AddCell(new Phrase("", FontFactory.GetFont(FontFactory.HELVETICA, 9, Font.BOLD)));
            datatable.AddCell(new Phrase("", FontFactory.GetFont(FontFactory.HELVETICA, 9, Font.BOLD)));
            datatable.AddCell(new Phrase("", FontFactory.GetFont(FontFactory.HELVETICA, 9, Font.BOLD)));
            datatable.AddCell(new Phrase("", FontFactory.GetFont(FontFactory.HELVETICA, 9, Font.BOLD)));
            datatable.AddCell(new Phrase("", FontFactory.GetFont(FontFactory.HELVETICA, 9, Font.BOLD)));
            datatable.AddCell(new Phrase("", FontFactory.GetFont(FontFactory.HELVETICA, 9, Font.BOLD)));



            for (int i = 0; i < ssReferenceCodeFINAL.Count; i++)
            {
                datatable.DefaultHorizontalAlignment = Element.ALIGN_LEFT;
                TRANS tRANS1 = new TRANS();
                tRANS1 = TRANSManager.GetTRANSByRefCode(ssReferenceCodeFINAL[i].ToString());

                if (tRANS1 != null)
                {
                    datatable.Alignment = Element.ALIGN_CENTER;


                    LOCATION lOCATION = new LOCATION();

                    lOCATION = LOCATIONManager.GetLOCATIONByID(int.Parse(tRANS1.LOCATIONID.ToString()));

                    if (lOCATION != null)
                    {
                        datatable.AddCell(lOCATION.BRANCH);
                        datatable.AddCell(lOCATION.CITY);
                        datatable.AddCell(lOCATION.COUNTRY);
                        datatable.AddCell("");
                        datatable.AddCell("");
                        datatable.AddCell("");
                        datatable.AddCell("");
                        datatable.AddCell("");
                        datatable.AddCell("");
                    }
                }
            }


            Cell cellReceiver = new Cell(new Phrase("Receiver Information  ", FontFactory.GetFont(FontFactory.HELVETICA, 10, Font.BOLD)));
            cellReceiver.HorizontalAlignment = Element.ALIGN_LEFT;
            cellReceiver.Colspan             = 9;
            cellReceiver.Border          = Rectangle.NO_BORDER;
            cellReceiver.BackgroundColor = new iTextSharp.text.Color(System.Drawing.Color.WhiteSmoke);
            datatable.AddCell(cellReceiver);


            datatable.DefaultCellBorderWidth     = 1;
            datatable.DefaultHorizontalAlignment = 1;
            datatable.DefaultRowspan             = 9;

            datatable.AddCell(new Phrase("First Name", FontFactory.GetFont(FontFactory.HELVETICA, 9, Font.BOLD)));
            datatable.AddCell(new Phrase("Last Name", FontFactory.GetFont(FontFactory.HELVETICA, 9, Font.BOLD)));
            datatable.AddCell(new Phrase("Middle Name", FontFactory.GetFont(FontFactory.HELVETICA, 9, Font.BOLD)));
            datatable.AddCell(new Phrase("Address", FontFactory.GetFont(FontFactory.HELVETICA, 9, Font.BOLD)));
            //datatable.AddCell(new Phrase("City", FontFactory.GetFont(FontFactory.HELVETICA, 9, Font.BOLD)));
            //datatable.AddCell(new Phrase("State", FontFactory.GetFont(FontFactory.HELVETICA, 9, Font.BOLD)));
            datatable.AddCell(new Phrase("Reference Code", FontFactory.GetFont(FontFactory.HELVETICA, 9, Font.BOLD)));
            datatable.AddCell(new Phrase("Charges", FontFactory.GetFont(FontFactory.HELVETICA, 9, Font.BOLD)));
            datatable.AddCell(new Phrase("Other Charges", FontFactory.GetFont(FontFactory.HELVETICA, 9, Font.BOLD)));
            datatable.AddCell(new Phrase("Amount Trans", FontFactory.GetFont(FontFactory.HELVETICA, 9, Font.BOLD)));
            datatable.AddCell(new Phrase("Total Amount", FontFactory.GetFont(FontFactory.HELVETICA, 9, Font.BOLD)));


            decimal smCharges      = 0;
            decimal smOtherCharges = 0;
            decimal smAmountTrans  = 0;
            decimal smTotalAmount  = 0;



            for (int i = 0; i < ssReferenceCodeFINAL.Count; i++)
            {
                datatable.DefaultHorizontalAlignment = Element.ALIGN_LEFT;
                TRANS tRANS1 = new TRANS();
                tRANS1 = TRANSManager.GetTRANSByRefCode(ssReferenceCodeFINAL[i].ToString());

                if (tRANS1 != null)
                {
                    datatable.Alignment = Element.ALIGN_CENTER;


                    RECEIVER rECEIVER = new RECEIVER();

                    rECEIVER = RECEIVERManager.GetRECEIVERByID(int.Parse(tRANS1.RECEIVERID.ToString()));

                    if (rECEIVER != null)
                    {
                        datatable.AddCell(rECEIVER.RECEIVERFNAME);
                        datatable.AddCell(rECEIVER.RECEIVERMNAME);
                        datatable.AddCell(rECEIVER.RECEIVERLNAME);
                        datatable.AddCell(rECEIVER.RECEIVERADDRESS1);
                        //datatable.AddCell(rECEIVER.RECEIVERCITY);
                        //datatable.AddCell(rECEIVER.RECEIVERSTATE);

                        datatable.AddCell(ssReferenceCodeFINAL[i].ToString());
                    }
                    datatable.AddCell(tRANS1.TRANSFEES.ToString());
                    datatable.AddCell(tRANS1.TRANSOTHERFEES.ToString());
                    datatable.AddCell(tRANS1.TRANSAMOUNT.ToString());
                    datatable.AddCell(tRANS1.TRANSTOTALAMOUNT.ToString());

                    smCharges      = smCharges + decimal.Parse(tRANS1.TRANSFEES.ToString());
                    smOtherCharges = smOtherCharges + decimal.Parse(tRANS1.TRANSOTHERFEES.ToString());
                    smAmountTrans  = smAmountTrans + decimal.Parse(tRANS1.TRANSAMOUNT.ToString());
                    smTotalAmount  = smTotalAmount + decimal.Parse(tRANS1.TRANSTOTALAMOUNT.ToString());
                }
            }



            //datatable.AddCell("");
            //datatable.AddCell("");
            datatable.AddCell("");
            datatable.AddCell("");
            datatable.AddCell("");
            datatable.AddCell("");

            datatable.AddCell(new Phrase("Total : ", FontFactory.GetFont(FontFactory.HELVETICA, 10, Font.BOLD)));
            datatable.AddCell(new Phrase(smCharges.ToString(), FontFactory.GetFont(FontFactory.HELVETICA, 10, Font.BOLD)));
            datatable.AddCell(new Phrase(smOtherCharges.ToString(), FontFactory.GetFont(FontFactory.HELVETICA, 10, Font.BOLD)));
            datatable.AddCell(new Phrase(smAmountTrans.ToString(), FontFactory.GetFont(FontFactory.HELVETICA, 10, Font.BOLD)));
            datatable.AddCell(new Phrase(smTotalAmount.ToString(), FontFactory.GetFont(FontFactory.HELVETICA, 10, Font.BOLD)));



            Cell cellConditionTitle = new Cell(new Phrase("CONDITIONS GOVERNING THE TRANSFER OF FUNDS", FontFactory.GetFont(FontFactory.HELVETICA, 14, Font.BOLD)));
            cellConditionTitle.HorizontalAlignment = Element.ALIGN_CENTER;
            cellConditionTitle.Colspan             = 9;

            cellConditionTitle.Border          = Rectangle.NO_BORDER;
            cellConditionTitle.BackgroundColor = new iTextSharp.text.Color(System.Drawing.Color.WhiteSmoke);
            datatable.AddCell(cellConditionTitle);



            string ConditionDesc = string.Empty;

            ConditionDesc = "Customer(s) (“You”) authorize KOROMSTAR ENTERPRISE (“Us/We”) to make thewire transfer described on this form.CURRENCYEXCHANGE:In addition to the transfer fee, KOROMSTAR ENTERPRISE also makes money when it changesyour dollars into foreign currency. Payments willgenerally be in local currency. In addition to the transfer feesapplicable to this transaction, a currency exchange rate will beapplied. United States currency is converted to foreign currency at anexchange rate set by KOROMSTAR ENTERPRISE. Any difference between the rate given to Customers and the rate receivedby KOROMSTAR ENTERPRISE will be kept by KOROMSTAR ENTERPRISE(and its Agents in some cases) in addition to the transfer fees.We may transfer funds through an Intermediary Bank or funds transfersystem tha is different from that shown in your instructions. If we receive your payment order after our processing ending hour, or ona weekend or holiday, we may process it on the next funds-transferbusiness day. A delay may also occur if an Intermediary Bank or theBeneficiary Bank is not accepting payment orders (e.g. due to a localholiday).You agree to hold KOROMSTAR ENTERPRISE  harmlessfrom any loss that occurs if your instructions are incomplete,ambiguous, or incorrect. We are not required to seek clarification fromanyone regarding ambiguous instructions. If we cannot complete atransfer .g. because of an ambiguity), we will notify you orally or inwriting at the end of the next business day.    We will not be liable for the consequential, special, or exemplarydamages or losses of any kind. We will not be liable for any failure toact or delay due to: circumstances beyond our control; fire, flood, ornatural disasters; communication failures; labor disputes; anyinaccuracy or ambiguity in your instructions; the action or inaction ofothers; or any applicable government or funds-transfer system rule,policy, or regulations.REFUNDOF PRINCIPAL AMOUNTand cancellation of the money transfer will be made upon written requestof the Sender if payment to the Receiver has not yet been made at thetime the request is processed by KOROMSTAR ENTERPRISE . REFUNDS OFTRANSFER FEES will be made upon written request of the Sender if themoney transfer is not available to the Receiver within the timespecified by KOROMSTAR ENTERPRISE  forthe selected service, subject to the hours of operation that the Serviceis offered at the Agent location selected by the Receiver for paymentand other special conditions. Refund will be made within 45 days ofreceipt of a valid written request from the Sender.LIMITATION OF LIABILITY: IN NO EVENT SHALL KOROMSTAR ENTERPRISE  BELIABLE FOR DAMAGES FOR DELAY, NON DELIVERY, NON PAYMENT OR UNDERPAYMENTOF ANY MONEY TRANSFER, OR ANY SUPPLEMENTAL MESSAGE WHETHER CAUSED BYNEGLIGENCE ON THE PART OF ITS EMPLOYEES, SUPPLIERS OR AGENTS OROTHERWISE BEYOND THE SUM OF $500 (in addition to refunding the principalamount of the money transfer and the transfer fees), IN NO EVENT WILLKOROMSTAR ENTERPRISE  BE LIABLE FORANY INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL EXEMPLENARY OR PUNITIVEDAMGES, OR THE LIKE. THESE CONDITIONS CANNOT BE CHANGED OR SUPPLEMENTEDORALLY.KOROMSTAR ENTERPRISE  reserved theright to limit the principal amount of a money transfer, or to reject aproposed money transfer, in its sole discretion. KOROMSTAR ENTERPRISE assumes no obligation fordamages resulting from nonpayment of the money transfer or any failureto complete any applicable Service transaction by reason of such lack ofauthorization. KOROMSTAR ENTERPRISE  reservesthe right to refuse to provide the Service to you at anytime for anyreason deemed necessary to protect KOROMSTAR ENTERPRISE ’s interests.";


            Cell cellConditionDesc = new Cell(new Phrase(ConditionDesc, FontFactory.GetFont(FontFactory.HELVETICA, 8, Font.NORMAL)));
            cellConditionDesc.HorizontalAlignment = Element.ALIGN_JUSTIFIED;
            cellConditionDesc.Colspan             = 9;
            cellConditionDesc.Border          = Rectangle.NO_BORDER;
            cellConditionDesc.BackgroundColor = new iTextSharp.text.Color(System.Drawing.Color.White);
            datatable.AddCell(cellConditionDesc);



            Cell cellAgentSignature = new Cell(new Phrase("AGENT SIGNATURE", FontFactory.GetFont(FontFactory.HELVETICA, 10, Font.NORMAL)));
            cellAgentSignature.HorizontalAlignment = Element.ALIGN_LEFT;
            cellAgentSignature.Leading             = 100;
            cellAgentSignature.Colspan             = 5;
            cellAgentSignature.Border          = Rectangle.NO_BORDER;
            cellAgentSignature.BackgroundColor = new iTextSharp.text.Color(System.Drawing.Color.White);
            datatable.AddCell(cellAgentSignature);



            Cell cellCustomerSignature = new Cell(new Phrase("CUSTOMER SIGNATURE", FontFactory.GetFont(FontFactory.HELVETICA, 10, Font.NORMAL)));
            cellCustomerSignature.HorizontalAlignment = Element.ALIGN_RIGHT;
            cellCustomerSignature.Leading             = 100;
            cellCustomerSignature.Colspan             = 4;
            cellCustomerSignature.Border          = Rectangle.NO_BORDER;
            cellCustomerSignature.BackgroundColor = new iTextSharp.text.Color(System.Drawing.Color.White);
            datatable.AddCell(cellCustomerSignature);



            document.Add(datatable);
        }
        catch (Exception e)
        {
            //Console.Error.WriteLine(e.Message);
        }

        document.Close();

        Response.Clear();
        Response.AddHeader("content-disposition", "attachment;filename=Receipt.pdf");
        Response.ContentType = "application/pdf";
        Response.BinaryWrite(msReport.ToArray());
        Response.End();
    }
    protected void btnProcessTransaction_Click(object sender, EventArgs e)
    {
        //try
        //{
        loadTransSession();

        if (Session["sessionTRANS"] != null)
        {
            int resutl1 = 0;
            //Session.Remove("ssReferenceCode");
            List <TRANS> SSTRANSFINAL = new List <TRANS>();
            SSTRANSFINAL = (List <TRANS>)Session["sessionTRANS"];
            TRANS tRANS1 = new TRANS();


            for (int i = 0; i < SSTRANSFINAL.Count; i++)
            {
                if (SSTRANSFINAL[i].CUSTID > 0)
                {
                    tRANS1.CUSTID = SSTRANSFINAL[i].CUSTID;
                }
                else
                {
                    continue;
                }
                tRANS1.RECEIVERID          = SSTRANSFINAL[i].RECEIVERID;
                tRANS1.LOCATIONID          = SSTRANSFINAL[i].LOCATIONID;
                tRANS1.TRANSDT             = SSTRANSFINAL[i].TRANSDT;
                tRANS1.TRANSAMOUNT         = SSTRANSFINAL[i].TRANSAMOUNT;
                tRANS1.TRANSFEES           = SSTRANSFINAL[i].TRANSFEES;
                tRANS1.TRANSOTHERFEES      = SSTRANSFINAL[i].TRANSOTHERFEES;
                tRANS1.CAUSETRANSOTHERFEES = SSTRANSFINAL[i].CAUSETRANSOTHERFEES;
                tRANS1.TRANSPROMOCODE      = SSTRANSFINAL[i].TRANSPROMOCODE;
                tRANS1.TRANSPROMO          = SSTRANSFINAL[i].TRANSPROMO;
                tRANS1.TRANSTOTALAMOUNT    = SSTRANSFINAL[i].TRANSTOTALAMOUNT;
                tRANS1.FLAG_SM_RECEIVER    = SSTRANSFINAL[i].FLAG_SM_RECEIVER;
                tRANS1.SM_RECEIVER         = SSTRANSFINAL[i].SM_RECEIVER;
                tRANS1.FLAG_CALL_RECEIVER  = SSTRANSFINAL[i].FLAG_CALL_RECEIVER;
                tRANS1.RECEIVERPHONENO     = SSTRANSFINAL[i].RECEIVERPHONENO;
                tRANS1.FLAG_DD             = SSTRANSFINAL[i].FLAG_DD;
                tRANS1.FLAG_TESTQUESTION   = SSTRANSFINAL[i].FLAG_TESTQUESTION;
                tRANS1.TESTQUESTION        = SSTRANSFINAL[i].TESTQUESTION;
                tRANS1.TESTANSWER          = SSTRANSFINAL[i].TESTANSWER;
                tRANS1.FLAG_CALLSENDER     = SSTRANSFINAL[i].FLAG_CALLSENDER;
                tRANS1.FLAG_SMSSENDER      = SSTRANSFINAL[i].FLAG_SMSSENDER;
                tRANS1.FLAG_EMAILSENDER    = SSTRANSFINAL[i].FLAG_EMAILSENDER;
                tRANS1.SENDEREMAILADDRESS  = SSTRANSFINAL[i].SENDEREMAILADDRESS;
                tRANS1.TRANSSTATUS         = SSTRANSFINAL[i].TRANSSTATUS;
                tRANS1.TRANSRECEIVEDID     = SSTRANSFINAL[i].TRANSRECEIVEDID;
                tRANS1.TRANSRECEIVEDATE    = SSTRANSFINAL[i].TRANSRECEIVEDATE;
                tRANS1.CREATEDBY           = SSTRANSFINAL[i].CREATEDBY;
                tRANS1.CREATEDON           = SSTRANSFINAL[i].CREATEDON;
                tRANS1.UPDATEDBY           = SSTRANSFINAL[i].UPDATEDBY;
                tRANS1.UPDATEDON           = SSTRANSFINAL[i].UPDATEDON;
                tRANS1.AGENTID             = SSTRANSFINAL[i].AGENTID;
                tRANS1.REFCODE             = SSTRANSFINAL[i].REFCODE;

                resutl1 = TRANSManager.InsertTRANS(tRANS1);

                List <string> ReferenceCodeLst = new List <string>();

                TRANS tRANSReferenceCode = new TRANS();
                tRANSReferenceCode = TRANSManager.GetTRANSByID(resutl1);

                if (Session["ssReferenceCode"] == null)
                {
                    ReferenceCodeLst.Add(tRANSReferenceCode.REFCODE.ToString());

                    if (tRANSReferenceCode != null)
                    {
                        Session["ssReferenceCode"] = ReferenceCodeLst;
                    }
                }


                else
                {
                    //TRANS tRANSReferenceCode = new TRANS();
                    //tRANSReferenceCode = TRANSManager.GetTRANSByID(resutl1);
                    ////((List<string>)Session["ssReferenceCode"]).Add(tRANSReferenceCode.REFCODE);

                    //if (tRANSReferenceCode != null)
                    //{
                    ((List <string>)Session["ssReferenceCode"]).Add(tRANSReferenceCode.REFCODE.ToString());
                    //}
                }
            }
            if (resutl1 > 0)
            {
                //Session.Remove("snlocationID");
                //Session.Remove("snsenderID");
                Session.Remove("snreceiverID");
                Session.Remove("sessionTRANS");
                Response.Redirect("Transmit.aspx");
            }
        }
        else
        {
            Response.Redirect("SearchSenderPage.aspx");
        }
        //}

        //catch (Exception Ex)
        //{
        //    lblmessage.Text = Ex.ToString();
        //}
    }
Beispiel #16
0
 protected void GetCustomerForSARSearch()
 {
     gvCustomer.DataSource = TRANSManager.GetAllSARFromTransBYDate(DateTime.Parse(txtFromDate.Text), DateTime.Parse(txtToDate.Text));
     gvCustomer.DataBind();
 }
    private void processPayemnt(string status)
    {
        int receiverID = 0;

        receiverID = selecetedGridRow();

        if (gvRECEIVER.Visible)
        {
            //update the sender
            RECEIVER tempRECEIVER = new RECEIVER();
            tempRECEIVER.RECEIVERID = int.Parse(txtMemberID.Text);

            tempRECEIVER.USERNAME         = "";
            tempRECEIVER.RECEIVERFNAME    = txtRECEIVERFNAME.Text;
            tempRECEIVER.RECEIVERMNAME    = txtRECEIVERMNAME.Text;
            tempRECEIVER.RECEIVERLNAME    = txtRECEIVERLNAME.Text;
            tempRECEIVER.RECEIVERADDRESS1 = txtAddress.Text;
            tempRECEIVER.RECEIVERADDRESS2 = "";
            tempRECEIVER.RECEIVERCITY     = txtCity.Text;
            tempRECEIVER.RECEIVERSTATE    = txtState.Text;
            tempRECEIVER.RECEIVERZIP      = txtZIP.Text;
            tempRECEIVER.RECEIVERPHONE    = txtPhoneNumber.Text;
            tempRECEIVER.CREATEDBY        = 1;
            tempRECEIVER.SCANURL          = "";
            tempRECEIVER.CREATEDON        = DateTime.Now;
            tempRECEIVER.UPDATEDBY        = int.Parse(Session["userInfoID"].ToString());
            tempRECEIVER.UPDATEDON        = DateTime.Now;
            bool result = RECEIVERManager.UpdateRECEIVER(tempRECEIVER);
        }
        else
        {
            //add receiver
            RECEIVER rECEIVER = new RECEIVER();

            rECEIVER.USERNAME         = User.Identity.Name.ToString();
            rECEIVER.RECEIVERFNAME    = txtRECEIVERFNAME.Text;
            rECEIVER.RECEIVERMNAME    = txtRECEIVERMNAME.Text;
            rECEIVER.RECEIVERLNAME    = txtRECEIVERLNAME.Text;
            rECEIVER.RECEIVERADDRESS1 = txtAddress.Text;
            rECEIVER.RECEIVERADDRESS2 = "";
            rECEIVER.RECEIVERCITY     = txtCity.Text;
            rECEIVER.RECEIVERSTATE    = txtState.Text;
            rECEIVER.RECEIVERZIP      = txtZIP.Text;
            rECEIVER.RECEIVERPHONE    = txtPhoneNumber.Text;
            rECEIVER.CREATEDBY        = int.Parse(Session["userInfoID"].ToString());
            rECEIVER.CREATEDON        = DateTime.Now;
            rECEIVER.UPDATEDBY        = int.Parse(Session["userInfoID"].ToString());
            rECEIVER.UPDATEDON        = DateTime.Now;
            rECEIVER.SCANURL          = "";
            txtMemberID.Text          = RECEIVERManager.InsertRECEIVER(rECEIVER).ToString();
        }

        //Process payment
        TRANS tempTRANS = new TRANS();

        tempTRANS.TRANSID = int.Parse(hfTransID.Value);

        tempTRANS.RECEIVERPHONENO     = txtPhoneNumber.Text;
        tempTRANS.SENDEREMAILADDRESS  = txtReceiverEmail.Text; //basically in DB there is no Receiver email id that is why we have given that here it will be the receiver id
        tempTRANS.CAUSETRANSOTHERFEES = hfCauseOtherServiceChages.Value + "\n" + txtCauseOtherServiceCharges.Text;
        tempTRANS.TRANSSTATUS         = status;
        tempTRANS.TRANSRECEIVEDID     = txtMemberID.Text;
        tempTRANS.TRANSRECEIVEDATE    = DateTime.Now;
        tempTRANS.UPDATEDBY           = int.Parse(Session["userInfoID"].ToString());//Session["lOCATION"] != null ? ((LOCATIONGROUP)Session["lOCATION"]).LOCATIONGROUPID : ((AGENT)Session["aGENT"]).AGENTID;
        tempTRANS.UPDATEDON           = DateTime.Now;
        if (TRANSManager.UpdateTRANS_Paid(tempTRANS))
        {
            lblmessage.Text      = "Payment done successfully...";
            lblmessage.ForeColor = System.Drawing.Color.Green;

            lblSubTotalSendingAmountTotal.Text = "0";
            lblSubTotalFeesTotal.Text          = "0";
            lblSubTotalDiscountTotal.Text      = "0";
            lblSubTotalTotalAmountTotal.Text   = "0";
            if (txtRefCodeForSearch.Text != "")
            {
                txtRefCodeForSearch.Text = "";
                return;
            }
            loadReport();

            txtReceiverEmail.Text = "";
            divPayment.Visible    = false;
        }
        else
        {
            lblmessage.Text      = "Error found..";
            lblmessage.ForeColor = System.Drawing.Color.Red;
        }
    }
 private void showTRANSGrid()
 {
     gvTRANS.DataSource = TRANSManager.GetAllTRANSsByCustomerID(int.Parse(Request.QueryString["cUSTID"].ToString()));
     gvTRANS.DataBind();
 }
    protected void gvLocation_RowDataBound(Object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            HiddenField hfAgnetID = (HiddenField)e.Row.FindControl("hfAgnetID");

            GridView gvTRANS = (GridView)e.Row.FindControl("gvTRANS");

            List <TRANS> tRANSs = new List <TRANS>();
            tRANSs = TRANSManager.GetTRANSByAgnetIDnLocationIDsByDateNAmount(getLocationIDs(), int.Parse(hfAgnetID.Value), txtFromDate.Text, txtToDate.Text, int.Parse(txtMoney.Text == "" ? "0" : txtMoney.Text));



            decimal sendingAmount = 0;
            decimal fees          = 0;
            decimal discount      = 0;
            decimal Total         = 0;

            foreach (TRANS tRANS in tRANSs)
            {
                sendingAmount += tRANS.TRANSAMOUNT;

                fees     += tRANS.TRANSFEES;//+ tRANS.TRANSOTHERFEES; because in the sp we have added already
                discount += tRANS.TRANSPROMO;
                Total    += tRANS.TRANSTOTALAMOUNT;

                //if (Session["userType"].ToString() != "Location")
                //{
                //    if (((AGENT)Session["aGENT"]).AGENTID == 4)//if the admin
                //    {
                //        tRANS.IsEdit = true;
                //    }
                //    else
                //    {
                //        tRANS.IsEdit = false;
                //    }
                //}
            }

            gvTRANS.DataSource = tRANSs;
            gvTRANS.DataBind();

            Label lblSubTotalSendingAmount = (Label)e.Row.FindControl("lblSubTotalSendingAmount");
            Label lblSubTotalFees          = (Label)e.Row.FindControl("lblSubTotalFees");
            Label lblSubTotalDiscount      = (Label)e.Row.FindControl("lblSubTotalDiscount");
            Label lblSubTotalTotalAmount   = (Label)e.Row.FindControl("lblSubTotalTotalAmount");

            lblSubTotalSendingAmount.Text = string.Format("{0:C}", double.Parse(sendingAmount.ToString()));
            lblSubTotalFees.Text          = string.Format("{0:C}", double.Parse(fees.ToString()));
            lblSubTotalDiscount.Text      = string.Format("{0:C}", double.Parse(discount.ToString()));
            lblSubTotalTotalAmount.Text   = string.Format("{0:C}", double.Parse(Total.ToString()));

            lblSubTotalSendingAmountTotal.Text = string.Format("{0}", double.Parse(lblSubTotalSendingAmountTotal.Text) + double.Parse(sendingAmount.ToString()));
            lblSubTotalFeesTotal.Text          = string.Format("{0}", double.Parse(lblSubTotalFeesTotal.Text) + double.Parse(fees.ToString()));
            lblSubTotalDiscountTotal.Text      = string.Format("{0}", double.Parse(lblSubTotalDiscountTotal.Text) + double.Parse(discount.ToString()));
            lblSubTotalTotalAmountTotal.Text   = string.Format("{0}", double.Parse(lblSubTotalTotalAmountTotal.Text) + double.Parse(Total.ToString()));

            if (Total > 0)
            {
                tblTotal.Visible = true;
            }
        }
    }
    protected void ProcessTransfer()
    {
        string senderID   = loadSenderID();
        string receiverID = loadReceiverID();
        string locationID = loadLoacationID(txtBranch.Text);

        if (
            senderID == "" ||
            senderID == null ||
            receiverID == "" ||
            receiverID == null ||
            locationID == "0" ||
            lblReferenceCode.Text == ""
            //|| checkRefCodeDuplicate()
            )
        {
            lblmessage.Text = "Incorrect Data";
            return;
        }
        else
        {
            TRANS tRANS = new TRANS();



            tRANS.CUSTID              = int.Parse(senderID);
            tRANS.RECEIVERID          = int.Parse(receiverID);
            tRANS.LOCATIONID          = int.Parse(locationID);;
            tRANS.TRANSDT             = DateTime.Parse(txtDate.Text);
            tRANS.TRANSAMOUNT         = decimal.Parse(txtSendingAmount.Text);
            tRANS.TRANSFEES           = decimal.Parse(txtServiceCharge.Text);
            tRANS.TRANSOTHERFEES      = decimal.Parse(txtOtherServiceCharge.Text);
            tRANS.CAUSETRANSOTHERFEES = txtCauseOtherServiceCharges.Text;
            tRANS.TRANSPROMOCODE      = txtDiscount.Text;
            tRANS.TRANSPROMO          = 0;
            tRANS.TRANSTOTALAMOUNT    = decimal.Parse(txtTotalCharge.Text);
            tRANS.FLAG_SM_RECEIVER    = 'N';
            tRANS.SM_RECEIVER         = "";
            tRANS.FLAG_CALL_RECEIVER  = 'N';
            tRANS.RECEIVERPHONENO     = "";
            tRANS.FLAG_DD             = 'N';
            tRANS.FLAG_TESTQUESTION   = 'N';
            tRANS.TESTQUESTION        = txtTestQuestion.Text;
            tRANS.TESTANSWER          = txtTestAnswer.Text;
            tRANS.FLAG_CALLSENDER     = 'N';
            tRANS.FLAG_SMSSENDER      = 'N';
            tRANS.FLAG_EMAILSENDER    = 'N';
            tRANS.SENDEREMAILADDRESS  = "";
            tRANS.TRANSSTATUS         = "PENDING";
            tRANS.TRANSRECEIVEDID     = "";
            tRANS.TRANSRECEIVEDATE    = DateTime.Now;
            tRANS.CREATEDBY           = 1;
            tRANS.CREATEDON           = DateTime.Now;
            tRANS.UPDATEDBY           = 1;
            tRANS.UPDATEDON           = DateTime.Now;
            tRANS.AGENTID             = 4;
            tRANS.REFCODE             = lblReferenceCode.Text;

            lblmessage.Text = TRANSManager.InsertTRANS(tRANS).ToString();
        }
    }
    protected void gvLocation_RowDataBound(Object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            HiddenField hfAgnetID = (HiddenField)e.Row.FindControl("hfAgnetID");
            GridView    gvPayment = (GridView)e.Row.FindControl("gvPayment");

            List <TRANS> tRANSs = new List <TRANS>();
            tRANSs = TRANSManager.GetTRANSByAgnetIDnLocationIDsByDateNAmount(getLocationIDs(), int.Parse(hfAgnetID.Value), txtFromDate.Text, txtToDate.Text, int.Parse(txtMoney.Text == "" ? "0" : txtMoney.Text));

            List <TRANS> tRANSsDistinct = new List <TRANS>();

            int count = 0;

            for (int i = 0; i < tRANSs.Count; i++)
            {
                count = tRANSsDistinct.FindAll(x => x.LOCATIONID == tRANSs[i].LOCATIONID).Count;

                if (count == 0)
                {
                    tRANSsDistinct.Add(tRANSs[i]);
                }
            }
            gvPayment.DataSource = tRANSsDistinct;
            gvPayment.DataBind();


            decimal totalAgentCommision = 0;
            for (int i = 0; i < gvPayment.Rows.Count; i++)
            {
                Label lblAgentID = (Label)gvPayment.Rows[i].FindControl("lblAgentID");
                lblAgentID.Text = hfAgnetID.Value.ToString();

                Label lblLocationID     = (Label)gvPayment.Rows[i].FindControl("lblLocationID");
                Label lblPayAgentID     = (Label)gvPayment.Rows[i].FindControl("lblAgentID");
                Label lblTransCount     = (Label)gvPayment.Rows[i].FindControl("lblTransCount");
                Label lblRate           = (Label)gvPayment.Rows[i].FindControl("lblRate");
                Label lblFees           = (Label)gvPayment.Rows[i].FindControl("lblFees");
                Label lblAgentCommision = (Label)gvPayment.Rows[i].FindControl("lblAgentCommision");

                Label lbllocationName = (Label)gvPayment.Rows[i].FindControl("lbllocationName");

                lblPayAgentID.Text = hfAgnetID.Value.ToString();

                if (lblPayAgentID.Text != "")
                {
                    List <TRANS> tRANSsTransactionCount = new List <TRANS>();
                    foreach (TRANS tRANS in tRANSs)
                    {
                        if (tRANS.LOCATIONID == int.Parse(lblLocationID.Text))
                        {
                            tRANSsTransactionCount.Add(tRANS);
                        }
                    }

                    lblTransCount.Text = tRANSsTransactionCount.Count.ToString();

                    LOCATION lOCATION = new LOCATION();
                    lOCATION = LOCATIONManager.GetLOCATIONByID(int.Parse(lblLocationID.Text));

                    lblRate.Text         = lOCATION.AGENTRATE.ToString();
                    lbllocationName.Text = lOCATION.BRANCH.ToString();

                    List <decimal> fees = new List <decimal>();
                    for (int j = 0; j < tRANSsTransactionCount.Count; j++)
                    {
                        fees.Add(tRANSsTransactionCount[j].TRANSFEES + tRANSsTransactionCount[j].TRANSOTHERFEES);
                    }

                    lblFees.Text = fees.Sum().ToString();


                    lblAgentCommision.Text = ((decimal.Parse(lblRate.Text) * decimal.Parse(lblFees.Text)) / 100).ToString();
                    totalAgentCommision    = decimal.Parse(lblAgentCommision.Text) + totalAgentCommision;
                    //just formating the currency
                    lblAgentCommision.Text = String.Format("{0:C}", decimal.Parse(lblAgentCommision.Text));


                    lblRate.Text = lOCATION.AGENTRATE.ToString() + "%";
                }
            }

            Label lblTotalAgentCommission = (Label)gvPayment.FooterRow.FindControl("lblTotalAgentCommission");

            lblTotalAgentCommission.Text = String.Format("{0:C}", totalAgentCommision);
        }
    }