private void loadReceiver()
    {
        List <RECEIVER> receivers = RECEIVERManager.GetAllRECEIVERByAgentID(int.Parse(ddlAgent.SelectedValue), int.Parse(Request.QueryString["CUSTIDs"]));

        gvReciver.DataSource = receivers;
        gvReciver.DataBind();
    }
Example #2
0
    protected void gvTRANS_RowDataBound(Object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            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");

            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();
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (!User.Identity.IsAuthenticated)
            {
                Session.RemoveAll(); Response.Redirect("LogInPage.aspx");
            }
            else
            {
                reLoadSession();
            }

            try
            {
                ((ASP.membermaster_master)Page.Master).RegisterPostbackTrigger(btnSave);

                ((ASP.membermaster_master)Page.Master).RegisterPostbackTrigger(btnUpdate);
            }
            catch
            {
            }

            if (User.Identity.IsAuthenticated)
            {
                if (Session["snFoodsenderID"] != null)
                {
                    if (Request.QueryString["rECEIVERID"] != null)
                    {
                        int rECEIVERID = Int32.Parse(Request.QueryString["rECEIVERID"]);
                        if (rECEIVERID == -1)
                        {
                            btnUpdate.Enabled = false;
                            btnSave.Enabled   = true;

                            List <RECEIVER> RECEIVERs = new List <RECEIVER>();
                            RECEIVERs = RECEIVERManager.GetAllRECEIVERs();

                            txtMemberID.Text = (int.Parse(RECEIVERs[RECEIVERs.Count - 1].RECEIVERID.ToString()) + 1).ToString();
                        }
                        else
                        {
                            btnSave.Enabled   = false;
                            btnUpdate.Enabled = true;
                            showRECEIVERData();
                        }
                    }
                }
                else
                {
                    Response.Redirect("SearchFoodSenderPage.aspx");
                }
            }
            else
            {
                Session.RemoveAll(); Response.Redirect("LogInPage.aspx");
            }
        }
    }
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        RECEIVER rECEIVER = new RECEIVER();

        rECEIVER = RECEIVERManager.GetRECEIVERByID(Int32.Parse(Request.QueryString["rECEIVERID"]));
        RECEIVER tempRECEIVER = new RECEIVER();

        tempRECEIVER.RECEIVERID = rECEIVER.RECEIVERID;

        tempRECEIVER.USERNAME         = User.Identity.Name.ToString();
        tempRECEIVER.RECEIVERFNAME    = txtRECEIVERFNAME.Text;
        tempRECEIVER.RECEIVERMNAME    = txtRECEIVERMNAME.Text;
        tempRECEIVER.RECEIVERLNAME    = txtRECEIVERLNAME.Text;
        tempRECEIVER.RECEIVERADDRESS1 = txtRECEIVERADDRESS1.Text;
        tempRECEIVER.RECEIVERADDRESS2 = txtRECEIVERADDRESS2.Text;
        tempRECEIVER.RECEIVERCITY     = txtRECEIVERCITY.Text;
        tempRECEIVER.RECEIVERSTATE    = txtRECEIVERSTATE.Text;
        tempRECEIVER.RECEIVERZIP      = txtRECEIVERZIP.Text;
        tempRECEIVER.RECEIVERPHONE    = txtRECEIVERPHONE.Text;
        tempRECEIVER.SCANURL          = rECEIVER.SCANURL;
        tempRECEIVER.CREATEDBY        = 1;
        tempRECEIVER.CREATEDON        = rECEIVER.CREATEDON;
        tempRECEIVER.UPDATEDBY        = int.Parse(Session["userInfoID"].ToString());
        tempRECEIVER.UPDATEDON        = DateTime.Now;

        if (uplFile.PostedFile != null && uplFile.PostedFile.ContentLength > 0)
        {
            try
            {
                string dirUrl  = "~/Uploads/Receiver";
                string dirPath = Server.MapPath(dirUrl);

                if (!Directory.Exists(dirPath))
                {
                    Directory.CreateDirectory(dirPath);
                }

                string fileName = Path.GetFileName(uplFile.PostedFile.FileName);
                string fileUrl  = dirUrl + "/" + Path.GetFileName(uplFile.PostedFile.FileName);
                string filePath = Server.MapPath(fileUrl);
                uplFile.PostedFile.SaveAs(filePath);

                tempRECEIVER.SCANURL = dirUrl + "/" + fileName;
            }
            catch (Exception ex)
            {
                lblMessage.Text = ex.Message.ToString();
            }
        }
        else
        {
            tempRECEIVER.SCANURL = rECEIVER.SCANURL;
        }

        bool result = RECEIVERManager.UpdateRECEIVER(tempRECEIVER);

        Session["snFoodreceiverID"] = Request.QueryString["rECEIVERID"];
        Response.Redirect("SearchFoodLocation.aspx");
    }
Example #5
0
    protected void gvFoodTransactionItemRelation_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            Label lblfID      = (Label)e.Row.FindControl("lblfID");
            Label lblFoodItem = (Label)e.Row.FindControl("lblFoodItem");

            Label lblfRATE    = (Label)e.Row.FindControl("lblfRATE");
            Label lblfQTY     = (Label)e.Row.FindControl("lblfQTY");
            Label lblSubTotal = (Label)e.Row.FindControl("lblSubTotal");
            Label lblTOTALAMT = (Label)e.Row.FindControl("lblTOTALAMT");


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

            Label lblCUSTFname     = (Label)e.Row.FindControl("lblCUSTFname");
            Label lblLOCATIONName  = (Label)e.Row.FindControl("lblLOCATIONName");
            Label lblRECEIVERFname = (Label)e.Row.FindControl("lblRECEIVERFname");

            FOODITEM_MASTER foodItems = new FOODITEM_MASTER();
            foodItems = FOODITEM_MASTERManager.GetFOODITEM_MASTERByID(int.Parse(lblfID.Text));

            if (Items != null)
            {
                lblFoodItem.Text = foodItems.ITEMNAME.ToString();
            }



            //lblSubTotal.Text = (decimal.Parse(lblfRATE.Text) * int.Parse(lblfQTY.Text)).ToString();

            CUSTOMER cUSTOMER = new CUSTOMER();
            cUSTOMER = CUSTOMERManager.GetCUSTOMERByID(int.Parse(lblCUSTID.Text));
            if (cUSTOMER != null)
            {
                lblCUSTFname.Text = cUSTOMER.CUSTFNAME.ToString();
            }

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

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

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

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

            lblTOTALAMT.Text = lblTOTALAMT.Text;
        }
    }
    protected void loadReceiverInfo()
    {
        RECEIVER rECEIVER = new RECEIVER();

        rECEIVER = RECEIVERManager.GetRECEIVERByID(int.Parse(Session["snFoodreceiverID"].ToString()));
        txtReceiverFirstName.Text  = rECEIVER.RECEIVERFNAME.ToString();
        txtReceiverMiddleName.Text = rECEIVER.RECEIVERMNAME.ToString();
        txtReceiverLastName.Text   = rECEIVER.RECEIVERLNAME.ToString();
    }
Example #7
0
    protected void loadReceiverInfo(int receiverID)
    {
        RECEIVER rECEIVER = new RECEIVER();

        rECEIVER = RECEIVERManager.GetRECEIVERByID(receiverID);
        txtReceiverFirstName.Text  = rECEIVER.RECEIVERFNAME.ToString();
        txtReceiverMiddleName.Text = rECEIVER.RECEIVERMNAME.ToString();
        txtReceiverLastName.Text   = rECEIVER.RECEIVERLNAME.ToString();
    }
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        int rECEIVERID = 0;

        rECEIVERID           = selecetedGridRow();
        gvwSearch.DataSource = RECEIVERManager.GetAllRECEIVERsForSearchByID(rECEIVERID);
        gvwSearch.DataBind();

        ModalPopupExtender1.Show();
    }
Example #9
0
    private void showRECEIVERData()
    {
        RECEIVER rECEIVER = new RECEIVER();

        rECEIVER = RECEIVERManager.GetRECEIVERByID(Int32.Parse(Request.QueryString["rECEIVERID"]));

        txtMemberID.Text         = rECEIVER.RECEIVERID.ToString();
        txtRECEIVERFNAME.Text    = rECEIVER.RECEIVERFNAME;
        txtRECEIVERMNAME.Text    = rECEIVER.RECEIVERMNAME;
        txtRECEIVERLNAME.Text    = rECEIVER.RECEIVERLNAME;
        txtRECEIVERADDRESS1.Text = rECEIVER.RECEIVERADDRESS1;
        txtRECEIVERADDRESS2.Text = rECEIVER.RECEIVERADDRESS2;
        txtRECEIVERCITY.Text     = rECEIVER.RECEIVERCITY;
        txtRECEIVERSTATE.Text    = rECEIVER.RECEIVERSTATE;
        txtRECEIVERZIP.Text      = rECEIVER.RECEIVERZIP;
        txtRECEIVERPHONE.Text    = rECEIVER.RECEIVERPHONE;
    }
    protected void btnSelectReciver_Click(object sender, EventArgs e)
    {
        int receiverID = 0;

        receiverID = selecetedGridRow();

        txtMemberID.Text    = receiverID.ToString();
        txtMemberID.Enabled = false;

        cleanElements();
        RECEIVER receiver = new RECEIVER();

        receiver = RECEIVERManager.GetRECEIVERByID(receiverID);

        txtAddress.Text       = receiver.RECEIVERADDRESS1;
        txtRECEIVERFNAME.Text = receiver.RECEIVERFNAME;
        txtRECEIVERMNAME.Text = receiver.RECEIVERMNAME;
        txtRECEIVERLNAME.Text = receiver.RECEIVERLNAME;
        txtCity.Text          = receiver.RECEIVERCITY;
        txtPhoneNumber.Text   = receiver.RECEIVERPHONE;
        txtState.Text         = receiver.RECEIVERSTATE;
        txtZIP.Text           = receiver.RECEIVERZIP;
    }
Example #11
0
    protected void gvTRANS_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            Label lblCUSTID       = (Label)e.Row.FindControl("lblCUSTID");
            Label lblRECEIVERID   = (Label)e.Row.FindControl("lblRECEIVERID");
            Label lblLOCATIONID   = (Label)e.Row.FindControl("lblLOCATIONID");
            Label lblCustName     = (Label)e.Row.FindControl("lblCustName");
            Label lblreceiverName = (Label)e.Row.FindControl("lblreceiverName");
            Label lblLocationName = (Label)e.Row.FindControl("lblLocationName");


            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)
            {
                lblreceiverName.Text = rECEIVER.RECEIVERFNAME + " " + rECEIVER.RECEIVERMNAME + " " + rECEIVER.RECEIVERLNAME;
            }

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

            if (lOCATION != null)
            {
                lblLocationName.Text = lOCATION.BRANCH.ToString();
            }
        }
    }
    protected List <RECEIVER> searchMemberInfo()
    {
        int    memberID    = 0;
        string membername  = "";
        string address     = "";
        string state       = "";
        string city        = "";
        string zip         = "";
        string phonenumber = "";

        if (txtMemberID.Text == "")
        {
            memberID = -1;
        }
        else
        {
            memberID = int.Parse(txtMemberID.Text);
        }

        if (txtRECEIVERFNAME.Text == "")
        {
            membername = "-1";
        }
        else
        {
            membername = txtRECEIVERFNAME.Text;
            memberID   = -1;
        }

        if (txtAddress.Text == "")
        {
            address = "-1";
        }
        else
        {
            address  = txtAddress.Text;
            memberID = -1;
        }

        if (txtState.Text == "")
        {
            state = "-1";
        }
        else
        {
            state    = txtState.Text;
            memberID = -1;
        }

        if (txtCity.Text == "")
        {
            city = "-1";
        }
        else
        {
            city     = txtCity.Text;
            memberID = -1;
        }

        if (txtZIP.Text == "")
        {
            zip = "-1";
        }
        else
        {
            zip      = txtZIP.Text;
            memberID = -1;
        }

        if (txtPhoneNumber.Text == "")
        {
            phonenumber = "-1";
        }
        else
        {
            phonenumber = txtPhoneNumber.Text;
            memberID    = -1;
        }

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

        receivers = memberID != -1 ? RECEIVERManager.GetAllRECEIVERsForSearchByIDNew(memberID) : RECEIVERManager.GetAllRECEIVERsForSearch(-1, memberID, membername, address, city, state, zip, phonenumber);

        gvRECEIVER.DataSource = receivers;
        gvRECEIVER.DataBind();

        return(receivers);
    }
Example #13
0
    protected void searchMemberInfo()
    {
        try
        {
            int    memberID    = 0;
            string membername  = "";
            string address     = "";
            string state       = "";
            string city        = "";
            string zip         = "";
            string phonenumber = "";

            if (txtMemberID.Text == "")
            {
                memberID = -1;
            }
            else
            {
                memberID = int.Parse(txtMemberID.Text);
            }

            if (txtName.Text == "")
            {
                membername = "-1";
            }
            else
            {
                membername = txtName.Text;
            }

            if (txtAddress.Text == "")
            {
                address = "-1";
            }
            else
            {
                address = txtAddress.Text;
            }

            if (txtState.Text == "")
            {
                state = "-1";
            }
            else
            {
                state = txtState.Text;
            }

            if (txtCity.Text == "")
            {
                city = "-1";
            }
            else
            {
                city = txtCity.Text;
            }

            if (txtZIP.Text == "")
            {
                zip = "-1";
            }
            else
            {
                zip = txtZIP.Text;
            }

            if (txtPhoneNumber.Text == "")
            {
                phonenumber = "-1";
            }
            else
            {
                phonenumber = txtPhoneNumber.Text;
            }



            gvRECEIVER.DataSource = RECEIVERManager.GetAllRECEIVERsForSearch(-1, memberID, membername, address, city, state, zip, phonenumber).FindAll(x => (x.AgentID == ((AGENT)Session["aGENT"]).AGENTID));
            gvRECEIVER.DataBind();
        }
        catch (Exception ex)
        {
        }
    }
Example #14
0
 protected void GetAllReceiverByCustID()
 {
     gvRECEIVER.DataSource = RECEIVERManager.GetAllRECEIVERsForSearch(int.Parse(Session["snsenderID"].ToString()), -1, "-1", "-1", "-1", "-1", "-1", "-1").FindAll(x => (x.AgentID == ((AGENT)Session["aGENT"]).AGENTID));
     gvRECEIVER.DataBind();
 }
Example #15
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;
        }
    }
    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;
        }
    }
Example #17
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();
    }
Example #18
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (txtRECEIVERFNAME.Text != "" && txtRECEIVERLNAME.Text != "")
        {
            RECEIVER rECEIVER = new RECEIVER();

            rECEIVER.USERNAME         = User.Identity.Name.ToString();
            rECEIVER.RECEIVERFNAME    = txtRECEIVERFNAME.Text;
            rECEIVER.RECEIVERMNAME    = txtRECEIVERMNAME.Text;
            rECEIVER.RECEIVERLNAME    = txtRECEIVERLNAME.Text;
            rECEIVER.RECEIVERADDRESS1 = txtRECEIVERADDRESS1.Text;
            rECEIVER.RECEIVERADDRESS2 = txtRECEIVERADDRESS2.Text;
            rECEIVER.RECEIVERCITY     = txtRECEIVERCITY.Text;
            rECEIVER.RECEIVERSTATE    = txtRECEIVERSTATE.Text;
            rECEIVER.RECEIVERZIP      = txtRECEIVERZIP.Text;
            rECEIVER.RECEIVERPHONE    = txtRECEIVERPHONE.Text;
            rECEIVER.SCANURL          = "";
            rECEIVER.CREATEDBY        = 1;
            rECEIVER.CREATEDON        = DateTime.Now;
            rECEIVER.UPDATEDBY        = 1;
            rECEIVER.UPDATEDON        = DateTime.Now;

            if (uplFile.PostedFile != null && uplFile.PostedFile.ContentLength > 0)
            {
                try
                {
                    string dirUrl  = "~/Uploads/Receiver";
                    string dirPath = Server.MapPath(dirUrl);

                    if (!Directory.Exists(dirPath))
                    {
                        Directory.CreateDirectory(dirPath);
                    }

                    string fileName = Path.GetFileName(uplFile.PostedFile.FileName);
                    string fileUrl  = dirUrl + "/" + Path.GetFileName(uplFile.PostedFile.FileName);
                    string filePath = Server.MapPath(fileUrl);
                    uplFile.PostedFile.SaveAs(filePath);

                    rECEIVER.SCANURL = dirUrl + "/" + fileName;
                }
                catch (Exception ex)
                {
                    lblMessage.Text = ex.Message.ToString();
                }
            }
            else
            {
                rECEIVER.SCANURL = "~/Uploads/Receiver/no_image.jpeg";
            }

            int resutl = RECEIVERManager.InsertRECEIVER(rECEIVER);
            if (resutl > 0)
            {
                Session["snreceiverID"] = resutl.ToString();
                Response.Redirect("SearchLocation.aspx");
            }
        }
        else
        {
            lblMessage.Text      = "Please enter the First Name and Last Name...";
            lblMessage.ForeColor = System.Drawing.Color.Red;
        }
    }