protected void loadCityByCountry() { ddlCity.Items.Clear(); ListItem li = new ListItem("-Select-", "0"); ddlCity.Items.Add(li); List <LOCATION> LOCATIONs = new List <LOCATION>(); LOCATIONs = LOCATIONManager.GetAllLOCATIONs().FindAll(x => x.COUNTRY == ddlCountry.SelectedItem.Value); List <string> onlyCity = new List <string>(); foreach (LOCATION location in LOCATIONs) { onlyCity.Add(location.CITY); } List <string> distinctCity = new List <string>(); distinctCity = onlyCity.Distinct().ToList(); for (int i = 0; i < distinctCity.Count; i++) { ListItem litems = new ListItem(distinctCity[i].ToString(), distinctCity[i].ToString()); ddlCity.Items.Add(litems); } ddlCity.DataBind(); }
protected void LoadBranch(int agentID) { ddlBranch.Items.Clear(); ListItem li = new ListItem("-Select-", "0"); ddlBranch.Items.Add(li); List <LOCATION> LOCATIONs = new List <LOCATION>(); LOCATIONs = LOCATIONManager.GetAllLOCATIONsByAgentID(agentID); List <string> onlyBranch = new List <string>(); foreach (LOCATION location in LOCATIONs) { onlyBranch.Add(location.BRANCH); } List <string> distinctBranch = new List <string>(); distinctBranch = onlyBranch.Distinct().ToList(); for (int i = 0; i < distinctBranch.Count; i++) { ListItem litems = new ListItem(distinctBranch[i].ToString(), distinctBranch[i].ToString()); ddlBranch.Items.Add(litems); } ddlBranch.DataBind(); }
protected void gvUSERINFO_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { Label lblAgent_LocationID = (Label)e.Row.FindControl("lblAgent_LocationID"); Label lblAgent_LocationName = (Label)e.Row.FindControl("lblAgent_LocationName"); if (ddlUserType.SelectedItem.Value.ToString() == "Agent") { AGENT aGENT = new AGENT(); aGENT = AGENTManager.GetAGENTByID(int.Parse(lblAgent_LocationID.Text)); if (aGENT != null) { lblAgent_LocationName.Text = aGENT.AGENTNAME.ToString(); } } else { LOCATION lOCATION = new LOCATION(); lOCATION = LOCATIONManager.GetLOCATIONByID(int.Parse(lblAgent_LocationID.Text)); if (lOCATION != null) { lblAgent_LocationName.Text = lOCATION.BRANCH.ToString(); } } } }
protected void loadLocation() { ddlLoction.Items.Clear(); ListItem li = new ListItem("Select Loction", "0"); ddlLoction.Items.Add(li); List <LOCATION> lOCATIONS = new List <LOCATION>(); lOCATIONS = LOCATIONManager.GetAllLOCATIONsFood().FindAll(x => x.AGENTID == ((AGENT)Session["aGENT"]).AGENTID); foreach (LOCATION location in lOCATIONS) { if (location.SEQUENCE == 0) { ListItem listItems = new ListItem(location.COUNTRY.ToString() + "--" + location.CITY.ToString() + "--" + location.BRANCH.ToString(), location.LOCATIONID.ToString()); ddlLoction.Items.Add(listItems); } } ddlLoction.DataBind(); ddlLoction.SelectedValue = Session["snFoodlocationID"].ToString(); }
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 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 loadLocationInfo() { LOCATION lOCATION = new LOCATION(); lOCATION = LOCATIONManager.GetLOCATIONByID(int.Parse(Session["snlocationID"].ToString())); txtBranch.Text = lOCATION.BRANCH.ToString(); lblRate.Text = lOCATION.AGENTRATE.ToString(); }
protected void loadLocationInfo(int locationID) { LOCATION lOCATION = new LOCATION(); lOCATION = LOCATIONManager.GetLOCATIONByID(locationID); txtBranch.Text = lOCATION.BRANCH.ToString(); lblRate.Text = lOCATION.AGENTRATE.ToString(); }
private void loadLocation() { List <LOCATION> locations = new List <LOCATION>(); locations = LOCATIONManager.GetAllLOCATIONs(); dlLocation.DataSource = locations; dlLocation.DataBind(); }
private void loadLocation() { List <LOCATION> locations = new List <LOCATION>(); if (Session["userType"] != null && (Session["lOCATION"] != null || Session["aGENT"] != null)) { if (Session["userType"].ToString() == "Location") { LOCATIONGROUP lOCATIONGROUP = new LOCATIONGROUP(); lOCATIONGROUP = (LOCATIONGROUP)Session["lOCATION"]; hfLoggedinLocationID.Value = lOCATIONGROUP.LOCATIONGROUPID.ToString(); if (ddlAgent.SelectedItem.Text != "All Agents") { locations = LOCATIONManager.GetAllLOCATIONsByAgentIDnGroupID(int.Parse(ddlAgent.SelectedItem.Value), int.Parse(hfLoggedinLocationID.Value)); } else { locations = LOCATIONManager.GetAllLOCATIONsByGroupID(int.Parse(hfLoggedinLocationID.Value)); } //locations = LOCATIONManager.GetAllLOCATIONsByGroupID(int.Parse(hfLoggedinLocationID.Value)); //trLocation.Visible = false; } else if (Session["userType"].ToString() == "Agent") { AGENT aGENT = (AGENT)Session["aGENT"]; hfAgentID.Value = aGENT.AGENTID.ToString(); trLocation.Visible = true; if (hfAgentID.Value == "4") { if (ddlAgent.SelectedItem.Text != "All Agents") { locations = LOCATIONManager.GetAllLOCATIONsByAgentID(int.Parse(ddlAgent.SelectedItem.Value)); } else { locations = LOCATIONManager.GetAllLOCATIONs(); } } else { locations = LOCATIONManager.GetAllLOCATIONsByAgentID(int.Parse(hfAgentID.Value)); } } dlLocation.DataSource = locations; dlLocation.DataBind(); tblSearchByRefCode.Visible = false; } else { Session.RemoveAll(); Response.Redirect("LogInPage.aspx"); } }
private void loadReport() { gvLocation.DataSource = LOCATIONManager.GetAllLOCATIONsForReportByDatenAmountLocationIDsStatus(loadStatus(), getLocationIDs(), int.Parse(ddlAgent.SelectedValue), txtFromDate.Text, txtToDate.Text, int.Parse(txtMoney.Text == "" ? "0" : txtMoney.Text)); gvLocation.DataBind(); lblSubTotalSendingAmountTotal.Text = string.Format("{0:C}", double.Parse(lblSubTotalSendingAmountTotal.Text)); lblSubTotalFeesTotal.Text = string.Format("{0:C}", double.Parse(lblSubTotalFeesTotal.Text)); lblSubTotalDiscountTotal.Text = string.Format("{0:C}", double.Parse(lblSubTotalDiscountTotal.Text)); lblSubTotalTotalAmountTotal.Text = string.Format("{0:C}", double.Parse(lblSubTotalTotalAmountTotal.Text)); }
private void loadReport() { gvLocation.DataSource = LOCATIONManager.GetAllLOCATIONsForReportByDatenAmountCustomerIDs(Request.QueryString["CUSTIDs"], getReceiverIDs(), int.Parse(ddlAgent.SelectedValue), txtFromDate.Text, txtToDate.Text, int.Parse(txtMoney.Text == "" ? "0" : txtMoney.Text)); gvLocation.DataBind(); lblSubTotalSendingAmountTotal.Text = string.Format("{0:C}", double.Parse(lblSubTotalSendingAmountTotal.Text)); lblSubTotalFeesTotal.Text = string.Format("{0:C}", double.Parse(lblSubTotalFeesTotal.Text)); lblSubTotalDiscountTotal.Text = string.Format("{0:C}", double.Parse(lblSubTotalDiscountTotal.Text)); lblSubTotalTotalAmountTotal.Text = string.Format("{0:C}", double.Parse(lblSubTotalTotalAmountTotal.Text)); }
protected void btnDelete_Click(object sender, EventArgs e) { int lOCATIONID = 0; lOCATIONID = selecetedGridRow(); gvwSearch.DataSource = LOCATIONManager.GetAllLOCATIONsForSearchByID(lOCATIONID); gvwSearch.DataBind(); ModalPopupExtender1.Show(); }
protected void GetlocationInfo() { LOCATION lOCATION = new LOCATION(); lOCATION = LOCATIONManager.GetLOCATIONByID(int.Parse(ddlLoction.SelectedItem.Value.ToString())); if (lOCATION != null) { txtCountry.Text = lOCATION.COUNTRY.ToString(); txtCity.Text = lOCATION.CITY.ToString(); txtBranch.Text = lOCATION.BRANCH.ToString(); loadFoodItem(LOCATIONMAPPINGManager.GetLOCATIONMAPPINGByLOCATIONID(int.Parse(ddlLoction.SelectedItem.Value.ToString()))[0].LOCATIONGROUPID); } }
protected void InsertlocationInfo() { LOCATION lOCATION = new LOCATION(); lOCATION.COUNTRY = txtCOUNTRY.Text; lOCATION.CITY = txtCITY.Text; lOCATION.BRANCH = txtBRANCH.Text; lOCATION.BRANCH_CODE = txtBRANCH_CODE.Text; lOCATION.SEQUENCE = Int32.Parse(txtSEQUENCE.Text); lOCATION.AGENTID = Int32.Parse(ddlAGENT.SelectedValue); lOCATION.AGENTRATE = decimal.Parse(txtAGENTRATE.Text); int resutl = LOCATIONManager.InsertLOCATION(lOCATION); lblMessage.Text = "Saved Successfully"; }
private void loadLOCATION() { ListItem li = new ListItem("Select LOCATION...", "0"); ddlLOCATION.Items.Add(li); List <LOCATION> lOCATIONs = new List <LOCATION>(); lOCATIONs = LOCATIONManager.GetAllLOCATIONs(); foreach (LOCATION lOCATION in lOCATIONs) { ListItem item = new ListItem(lOCATION.BRANCH.ToString(), lOCATION.LOCATIONID.ToString()); ddlLOCATION.Items.Add(item); } }
private void loadLOCATIONAll() { ListItem li = new ListItem("Select LOCATION...", "0"); ddlLOCATION.Items.Add(li); List <LOCATION> lOCATIONs = new List <LOCATION>(); lOCATIONs = LOCATIONManager.GetAllLOCATIONs(); foreach (LOCATION lOCATION in lOCATIONs) { string loc = lOCATION.COUNTRY + " > " + lOCATION.CITY + " > " + lOCATION.BRANCH; ListItem item = new ListItem(loc, lOCATION.LOCATIONID.ToString()); ddlLOCATION.Items.Add(item); } }
private void loadLocation() { List <LOCATION> locations = new List <LOCATION>(); if (hfAgentID.Value == "4")//main office will c all the report { locations = LOCATIONManager.GetAllLOCATIONs(); } else { locations = LOCATIONManager.GetAllLOCATIONsByAgentID(int.Parse(hfAgentID.Value)); } dlLocation.DataSource = locations; dlLocation.DataBind(); }
private void showLocationData() { int locationID = 0; locationID = selecetedGridRow(); LOCATION lOCATION = new LOCATION(); lOCATION = LOCATIONManager.GetLOCATIONByID(locationID); lblLocationID.Text = locationID.ToString(); txtCOUNTRY.Text = lOCATION.COUNTRY; txtCITY.Text = lOCATION.CITY; txtBRANCH.Text = lOCATION.BRANCH; txtBRANCH_CODE.Text = lOCATION.BRANCH_CODE; txtSEQUENCE.Text = lOCATION.SEQUENCE.ToString(); ddlAGENT.SelectedValue = lOCATION.AGENTID.ToString(); txtAGENTRATE.Text = lOCATION.AGENTRATE.ToString(); }
protected void ddlLOCATIONGROUP_SelectedIndexChanged(object sender, EventArgs e) { ddlLOCATION.Items.Clear(); ListItem li = new ListItem("Select LOCATION...", "0"); ddlLOCATION.Items.Add(li); if (ddlLOCATIONGROUP.SelectedValue != "0") { List <LOCATION> lOCATIONs = new List <LOCATION>(); //lOCATIONs = LOCATIONManager.GetAllLOCATIONsNotInGroup(); lOCATIONs = LOCATIONManager.GetAllLOCATIONsNotInGroupByGroupID(int.Parse(ddlLOCATIONGROUP.SelectedValue)); foreach (LOCATION lOCATION in lOCATIONs) { string loc = lOCATION.COUNTRY + " > " + lOCATION.CITY + " > " + lOCATION.BRANCH + " > " + lOCATION.BRANCH_CODE; ListItem item = new ListItem(loc, lOCATION.LOCATIONID.ToString()); ddlLOCATION.Items.Add(item); } } }
private void showLOCATIONMAPPINGGrid() { gvLOCATIONMAPPING.DataSource = LOCATIONMAPPINGManager.GetAllLOCATIONMAPPINGs(); gvLOCATIONMAPPING.DataBind(); foreach (GridViewRow gvr in gvLOCATIONMAPPING.Rows) { Label lblLOCATIONID = gvr.FindControl("lblLOCATIONID") as Label; Label lblLOCATIONGROUPID = gvr.FindControl("lblLOCATIONGROUPID") as Label; LOCATION location = LOCATIONManager.GetLOCATIONByID(int.Parse(lblLOCATIONID.Text)); if (location != null) { lblLOCATIONID.Text = location.COUNTRY + ", " + location.CITY + ", " + location.BRANCH; } LOCATIONGROUP locationGroup = LOCATIONGROUPManager.GetLOCATIONGROUPByID(int.Parse(lblLOCATIONGROUPID.Text)); if (locationGroup != null) { lblLOCATIONGROUPID.Text = locationGroup.GROUPNAME; } } }
protected void UpdateLocationInfo() { int locationID = 0; locationID = selecetedGridRow(); lblLocationID.Text = locationID.ToString(); LOCATION tempLOCATION = new LOCATION(); tempLOCATION.LOCATIONID = locationID; tempLOCATION.COUNTRY = txtCOUNTRY.Text; tempLOCATION.CITY = txtCITY.Text; tempLOCATION.BRANCH = txtBRANCH.Text; tempLOCATION.BRANCH_CODE = txtBRANCH_CODE.Text; tempLOCATION.SEQUENCE = Int32.Parse(txtSEQUENCE.Text); tempLOCATION.AGENTID = Int32.Parse(ddlAGENT.SelectedValue); tempLOCATION.AGENTRATE = decimal.Parse(txtAGENTRATE.Text); bool result = LOCATIONManager.UpdateLOCATION(tempLOCATION); lblMessage.Text = "Update Sucessfully"; }
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 void SearchLocationInfo() { string country = ""; string city = ""; string branch = ""; if (ddlCountry.SelectedItem.Value == "0") { country = "-1"; } else { country = ddlCountry.SelectedItem.Value; } if (ddlCity.SelectedItem.Value == "0") { city = "-1"; } else { city = ddlCity.SelectedItem.Value; } if (ddlBranch.SelectedItem.Value == "0") { branch = "-1"; } else { branch = ddlBranch.SelectedItem.Value; } gvLocationInfo.DataSource = LOCATIONManager.GetAllLOCATIONsForSearch(int.Parse(hfAgentID.Value), country, city, branch); gvLocationInfo.DataBind(); }
protected void btnSearch_Click(object sender, EventArgs e) { string country = ""; string city = ""; string branch = ""; if (ddlCountry.SelectedItem.Value == "0") { country = "-1"; } else { country = ddlCountry.SelectedItem.Value; } if (ddlCity.SelectedItem.Value == "0") { city = "-1"; } else { city = ddlCity.SelectedItem.Value; } if (ddlBranch.SelectedItem.Value == "0") { branch = "-1"; } else { branch = ddlBranch.SelectedItem.Value; } gvLocationInfo.DataSource = LOCATIONManager.GetAllLOCATIONsForSearch(int.Parse(hfAgentID.Value), country, city, branch).FindAll(x => x.SEQUENCE == 0); gvLocationInfo.DataBind(); }
protected void GetlocationInfo() { LOCATION lOCATION = new LOCATION(); lOCATION = LOCATIONManager.GetLOCATIONByID(int.Parse(ddlLoction.SelectedItem.Value.ToString())); if (lOCATION != null) { txtCountry.Text = lOCATION.COUNTRY.ToString(); txtCity.Text = lOCATION.CITY.ToString(); txtBranch.Text = lOCATION.BRANCH.ToString(); //if (txtCity.Text == "GUI-FOOD") //{ loadFoodItem(LOCATIONMAPPINGManager.GetLOCATIONMAPPINGByLOCATIONID(int.Parse(ddlLoction.SelectedItem.Value.ToString()))[0].LOCATIONGROUPID); //} //else //{ // loadFoodItem(1); //} Session["snFoodlocationID"] = ddlLoction.SelectedItem.Value.ToString(); } }
protected void LoadCountry(int agentID) { ddlCountry.Items.Clear(); ListItem li = new ListItem("-Select-", "0"); ddlCountry.Items.Add(li); List <LOCATION> countrys = new List <LOCATION>(); countrys = LOCATIONManager.GetAllLOCATIONsByAgentID(agentID); List <string> onlyCountry = new List <string>(); string allCountry = " "; foreach (LOCATION country in countrys) { onlyCountry.Add(country.COUNTRY.ToString()); } List <string> distinctCountry = new List <string>(); distinctCountry = onlyCountry.Distinct().ToList(); for (int i = 0; i < distinctCountry.Count; i++) { ListItem litems = new ListItem(distinctCountry[i].ToString(), distinctCountry[i].ToString()); ddlCountry.Items.Add(litems); } ddlCountry.DataBind(); loadCityByCountry(); }
private void showLOCATIONGrid() { GridView1.DataSource = LOCATIONManager.GetAllLOCATIONs().FindAll(x => x.COUNTRY == "GUINEA"); GridView1.DataBind(); }
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 LoadAllLocation() { gvLocationInfo.DataSource = LOCATIONManager.GetAllLOCATIONs(); gvLocationInfo.DataBind(); txtNumberOfBranch.Text = gvLocationInfo.Rows.Count.ToString(); }