public IHttpActionResult PutPartyLedger(long id, PartyLedger partyLedger) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != partyLedger.ID) { return(BadRequest()); } db.Entry(partyLedger).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!PartyLedgerExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetPartyLedger(long id) { PartyLedger partyLedger = db.PartyLedgers.Find(id); if (partyLedger == null) { return(NotFound()); } return(Ok(partyLedger)); }
public IHttpActionResult PostPartyLedger(PartyLedger partyLedger) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.PartyLedgers.Add(partyLedger); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = partyLedger.ID }, partyLedger)); }
public IHttpActionResult DeletePartyLedger(long id) { PartyLedger partyLedger = db.PartyLedgers.Find(id); if (partyLedger == null) { return(NotFound()); } db.PartyLedgers.Remove(partyLedger); db.SaveChanges(); return(Ok(partyLedger)); }
private void BtnLoad_Click(object sender, EventArgs e) { try { Cursor.Current = Cursors.WaitCursor; StartDate = _RangeSelector.DtFrom.DateTime.Date; EndDate = _RangeSelector.DtEnd.DateTime.Date; DataRow Currentrow = HelpGrid.GetDataRow(HelpGrid.FocusedRowHandle); switch (GlobalVariables.ProgCode) { case "PROG143": DataSet Ds = ProjectFunctions.GetDataSet(string.Format("Exec [Sp_CashBookRpt] '{0:yyyy-MM-dd}', '{1:yyyy-MM-dd}'", StartDate.Date, EndDate.Date)); rpt_CashBook RptDoc1 = new rpt_CashBook(); (RptDoc1.ReportDefinition.ReportObjects["txtCompanyName"] as TextObject).Text = GlobalVariables.CompanyName; (RptDoc1.ReportDefinition.ReportObjects["txtReportHead"] as TextObject).Text = "CASH BOOK"; (RptDoc1.ReportDefinition.ReportObjects["txtDateRange"] as TextObject).Text = string.Format("From ({0} to {1}) ", StartDate.Date.ToString("dd-MM-yyyy"), EndDate.Date.ToString("dd-MM-yyyy")); RptDoc1.SetDataSource(Ds.Tables[0]); lbl.Text = string.Format(Title + " ({0} to {1}) ", StartDate.Date.ToString("dd-MM-yyyy"), EndDate.Date.ToString("dd-MM-yyyy")); crystalReportViewer1.ReportSource = RptDoc1; _RangeSelector.Hide(); break; case "PROG144": HelpGrid.CloseEditor(); HelpGrid.UpdateCurrentRow(); DataSet DsRecoBank = ProjectFunctions.GetDataSet(string.Format("Exec [SP_RecoBank] '{0:yyyy-MM-dd}', '253'", EndDate.Date)); rpt_BankReco RptDoc2 = new rpt_BankReco(); (RptDoc2.ReportDefinition.ReportObjects["txtCompanyName"] as TextObject).Text = GlobalVariables.CompanyName; (RptDoc2.ReportDefinition.ReportObjects["txtReportName"] as TextObject).Text = "Bank Reco"; (RptDoc2.ReportDefinition.ReportObjects["txtDateRange"] as TextObject).Text = string.Format("From ({0} to {1}) ", StartDate.Date.ToString("dd-MM-yyyy"), EndDate.Date.ToString("dd-MM-yyyy")); RptDoc2.SetDataSource(DsRecoBank.Tables[0]); lbl.Text = string.Format(Title + " ({0} to {1}) ", StartDate.Date.ToString("dd-MM-yyyy"), EndDate.Date.ToString("dd-MM-yyyy")); crystalReportViewer1.ReportSource = RptDoc2; crystalReportViewer1.Show(); crystalReportViewer1.BringToFront(); _RangeSelector.Hide(); HelpGridCtrl.Hide(); break; case "PROG145": DataSet dsDayBook = ProjectFunctions.GetDataSet(string.Format("[Sp_PrepareDayBook] '{0:yyyy-MM-dd}', '{1:yyyy-MM-dd}'", StartDate.Date, EndDate.Date)); rpt_DayBook RptDoc3 = new rpt_DayBook(); (RptDoc3.ReportDefinition.ReportObjects["txtCompanyName"] as TextObject).Text = GlobalVariables.CompanyName; (RptDoc3.ReportDefinition.ReportObjects["txtReportHead"] as TextObject).Text = "Day Book"; (RptDoc3.ReportDefinition.ReportObjects["txtDateRange"] as TextObject).Text = string.Format("From ({0} to {1}) ", StartDate.Date.ToString("dd-MM-yyyy"), EndDate.Date.ToString("dd-MM-yyyy")); RptDoc3.SetDataSource(dsDayBook.Tables[0]); lbl.Text = string.Format(Title + " ({0} to {1}) ", StartDate.Date.ToString("dd-MM-yyyy"), EndDate.Date.ToString("dd-MM-yyyy")); crystalReportViewer1.ReportSource = RptDoc3; crystalReportViewer1.Show(); crystalReportViewer1.BringToFront(); _RangeSelector.Hide(); break; case "PROG147": DataSet ds = ProjectFunctions.GetDataSet(string.Format("[Sp_PrepareBankBook] '{0:yyyy-MM-dd}', '{1:yyyy-MM-dd}'", StartDate.Date, EndDate.Date)); Rpt_BankBook RptDoc = new Rpt_BankBook(); (RptDoc.Section2.ReportObjects["txtCompanyName"] as TextObject).Text = GlobalVariables.CompanyName; (RptDoc.Section2.ReportObjects["txtReportName"] as TextObject).Text = "Bank Book"; (RptDoc.Section2.ReportObjects["txtDateRange"] as TextObject).Text = string.Format("From ({0} to {1}) ", StartDate.Date.ToString("dd-MM-yyyy"), EndDate.Date.ToString("dd-MM-yyyy")); lbl.Text = string.Format(Title + " ({0} to {1})", StartDate.Date.ToString("dd-MM-yyyy"), EndDate.Date.ToString("dd-MM-yyyy")); RptDoc.SetDataSource(ds.Tables[0]); crystalReportViewer1.ReportSource = RptDoc; crystalReportViewer1.Show(); crystalReportViewer1.BringToFront(); _RangeSelector.Hide(); break; case "PROG165": if (Currentrow != null) { DataSet dsLedger = ProjectFunctions.GetDataSet(string.Format("[sp_ZoomPartyAct] '{0:yyyy-MM-dd}', '{1:yyyy-MM-dd}','{2}'", StartDate.Date, EndDate.Date, Currentrow["AccCode"].ToString())); PartyLedger RptLedger = new PartyLedger(); (RptLedger.Section2.ReportObjects["txtCompanyName"] as TextObject).Text = GlobalVariables.CompanyName; (RptLedger.Section2.ReportObjects["txtReportName"] as TextObject).Text = "Party Ledger"; (RptLedger.Section2.ReportObjects["txtDateRange"] as TextObject).Text = string.Format("From ({0} to {1}) ", StartDate.Date.ToString("dd-MM-yyyy"), EndDate.Date.ToString("dd-MM-yyyy")); lbl.Text = string.Format(Title + " ({0} to {1})", StartDate.Date.ToString("dd-MM-yyyy"), EndDate.Date.ToString("dd-MM-yyyy")); RptLedger.SetDataSource(dsLedger.Tables[0]); crystalReportViewer1.ReportSource = RptLedger; crystalReportViewer1.Show(); crystalReportViewer1.BringToFront(); _RangeSelector.Hide(); } else { ProjectFunctions.SpeakError("Plz Select Party First"); } break; default: break; } } catch (Exception ex) { XtraMessageBox.Show(ex.Message); } }