protected void Page_Load(object sender, EventArgs e) { #region test int intPartyID = Convert.ToInt32(Request.QueryString["code"]); string bagLoans = Request.QueryString["bagLoans"]; string carryingCost = Request.QueryString["carryingCost"]; if (intPartyID > 0) { ReportManager rptManager = new ReportManager(); //_Party = new PartyManager.GetPartyByID(intPartyID); _Party = rptManager.GetPartyByID(intPartyID); // txtCode.Text = _Party.PartyID; //txtserid.Text=_Party //txtpartycode.Text = _Party.PartyID.ToString(); //txtCode.Text = _Party.PartyCode; String name = _Party.PartyName; String fName = _Party.FatherName; string partType = _Party.PartyType; String village = _Party.AreaVillageName; String po = _Party.AreaPOName; String cellNo = _Party.Cell; string district = rptManager.getdist(Convert.ToInt32(_Party.DistrictID)).DistrictName; string upazila = rptManager.getupzilla(Convert.ToInt32(_Party.UpazilaPSID)).UpazilaPSName; ReportDocument rptDoc = new ReportDocument(); dsAgreementReport ds = new dsAgreementReport(); DataTable dt = new DataTable(); // dt.TableName = "Crystal Report Example"; //// dt = getAllOrders(); //This function is located below this function // dt = getFakeDbOrders(); // ds.Tables[0].Merge(dt); rptDoc.Load(Server.MapPath("../Delivery/rptDeliveryReport.rpt")); rptDoc.FileName = Server.MapPath("../Delivery/rptDeliveryReport.rpt"); rptDoc.SetDataSource(ds); //report.SetParameterValue("@Userid", userid); rptDoc.SetParameterValue("CustomerCode", intPartyID); rptDoc.SetParameterValue("CustomerName", name); rptDoc.SetParameterValue("FatherName", fName); rptDoc.SetParameterValue("MobileNo", cellNo); rptDoc.SetParameterValue("village", village); rptDoc.SetParameterValue("PO", po); rptDoc.SetParameterValue("Bag Loans", bagLoans); rptDoc.SetParameterValue("Carrying Cost", carryingCost); rptDoc.SetParameterValue("District", district); rptDoc.SetParameterValue("Upazila", upazila); CrystalReportViewer1.ReportSource = rptDoc; } #endregion }
/// <summary> /// Method to save (add/edit) party object /// </summary> /// <param name="party"></param> /// <returns></returns> public bool SaveParty(INVParty party) { try { if (party.PartyID == 0) { return _PartyDAOLinq.Add(party); } else { return _PartyDAOLinq.Edit(party, true); } } catch (Exception ex) { return false; } }
public bool DeleteParty(INVParty party) { try { if (party.PartyID > 0) { return _PartyDAOLinq.Delete(party, true); } else { return false; } } catch (Exception ex) { return false; } }
private void LoadToAllControlValue(int intPartyID) { if (intPartyID > 0) { _Party = new PartyManager().GetPartyByID(intPartyID); txtCode.Text = _Party.PartyCode; txtName.Text = _Party.PartyName; txtFather.Text = _Party.FatherName; ddlType.SelectedValue = _Party.PartyType; txtContactNo.Text = _Party.ContactNo; ddlGender.SelectedValue = _Party.Gender; ddlReligion.SelectedValue = _Party.Religion; txtVillage.Text = _Party.AreaVillageName; txtPO.Text = _Party.AreaPOName; ddlDistrict.SelectedValue = _Party.DistrictID.ToString(); ddlUpazila.SelectedValue = _Party.UpazilaPSID.ToString(); txtTel.Text = _Party.Tel; txtCell.Text = _Party.Cell; txtEmail.Text = _Party.Email; } }
private INVParty FormToObject(int id) { if (id <= 0) { _Party = new INVParty(); _Party.CreatedBy = WebCommonUtility.GetCSMSysUserKey(); _Party.CreatedDate = System.DateTime.Now; } _Party.ModifiedBy = WebCommonUtility.GetCSMSysUserKey(); _Party.ModifiedDate = System.DateTime.Now; _Party.PartyID = id; _Party.PartyCode = txtCode.Text; _Party.PartyName = txtName.Text; _Party.FatherName = txtFather.Text; _Party.PartyType = ddlType.SelectedValue.ToString(); _Party.ContactNo = txtContactNo.Text; _Party.Gender = ddlGender.SelectedValue.ToString(); _Party.Religion = ddlReligion.SelectedValue.ToString(); _Party.AreaVillageName = txtVillage.Text; _Party.AreaPOName = txtPO.Text; _Party.UpazilaPSID = ddlUpazila.SelectedIndex > 0 ? Convert.ToInt32(ddlUpazila.SelectedValue.ToString()) : 0; _Party.DistrictID = ddlDistrict.SelectedIndex > 0 ? Convert.ToInt32(ddlDistrict.SelectedValue.ToString()) : 0; _Party.Tel = txtTel.Text; _Party.Cell = txtCell.Text; _Party.Email = txtEmail.Text; _Party.PartyCodeName = txtCode.Text + " - " + txtName.Text; _Party.IsActive = true; return _Party; }
private void LoadToAllControlValue(int intPartyID) { if (intPartyID > 0) { ReportManager rptManager = new ReportManager(); //_Party = new PartyManager.GetPartyByID(intPartyID); _Party = rptManager.GetPartyByID(intPartyID); // txtCode.Text = _Party.PartyID; txtCode.Text = _Party.PartyCode; txtpartycode.Text = _Party.PartyID.ToString(); txtName.Text = _Party.PartyName; txtFather.Text = _Party.FatherName; txtPartyType.Text = _Party.PartyType; txtVillage.Text = _Party.AreaVillageName; txtPO.Text = _Party.AreaPOName; txtCellNo.Text = _Party.Cell; txtDistrict.Text = rptManager.getdist(Convert.ToInt32(_Party.DistrictID)).DistrictName; txtUpazilla.Text = rptManager.getupzilla(Convert.ToInt32(_Party.UpazilaPSID)).UpazilaPSName; } }
partial void DeleteINVParty(INVParty instance);
partial void UpdateINVParty(INVParty instance);
partial void InsertINVParty(INVParty instance);
private void detach_INVParties(INVParty entity) { this.SendPropertyChanging(); entity.ADMUpazilaPS = null; }
private void DeleteParty(int id) { _Party = new INVParty(); _Party.PartyID = id; if (new PartyManager().DeleteParty(_Party)) { grvParty.DataBind(); } }
private void LoadToAllControlValue(int intPartyID) { if (intPartyID > 0) { ReportManager rptManager = new ReportManager(); //_Party = new PartyManager.GetPartyByID(intPartyID); _Party = rptManager.GetPartyByID(intPartyID); // txtCode.Text = _Party.PartyID; //txtserid.Text=_Party txtpartycode.Text = _Party.PartyID.ToString(); txtCode.Text = _Party.PartyCode; txtName.Text = _Party.PartyName; txtFather.Text = _Party.FatherName; txtPartyType.Text = _Party.PartyType; txtVillage.Text = _Party.AreaVillageName; txtPO.Text = _Party.AreaPOName; txtCellNo.Text = _Party.Cell; txtDistrict.Text = rptManager.getdist(Convert.ToInt32(_Party.DistrictID)).DistrictName; txtUpazilla.Text = rptManager.getupzilla(Convert.ToInt32(_Party.UpazilaPSID)).UpazilaPSName; string partyCode = txtCode.Text; if (partyCode.Contains("F") || partyCode.Contains("P")) { txtBagloans.Enabled = true; txtCarryingCost.Enabled = true; } else { txtBagloans.Enabled = false; txtCarryingCost.Enabled = false; } } }