protected void GrdReport_RowDataBound(object sender, GridViewRowEventArgs e) { try { if (e.Row.RowType == DataControlRowType.DataRow) { Inward += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Inward")); Outward += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Outward")); Damaged += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Damage")); Closing += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Closing")); Amount += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Amount")); } if (e.Row.RowType == DataControlRowType.Footer) { e.Row.Cells[6].Text = "Total"; e.Row.Cells[7].Text = Inward.ToString("0.00"); e.Row.Cells[8].Text = Outward.ToString("0.00"); e.Row.Cells[9].Text = Damaged.ToString("0.00"); e.Row.Cells[10].Text = Closing.ToString("0.00"); e.Row.Cells[11].Text = Amount.ToString("0.00"); } } catch (Exception ex) { } }
public ActionResult DeleteConfirmed(int id) { Outward outward = db.Outwards.Find(id); db.Outwards.Remove(outward); db.SaveChanges(); return(RedirectToAction("Index")); }
protected void GrdReport_RowDataBound(object sender, GridViewRowEventArgs e) { try { if (e.Row.RowType == DataControlRowType.DataRow) { SystemOpening += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "SystemOpening")); ActualOpening += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "ActualOpening")); Purchase += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Purchase")); Sales += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Sales")); SalesReturn += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "SalesReturn")); Inward += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Inward")); Outward += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Outward")); OutwardReturn += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "OutwardReturn")); TransferIN += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "TransferIN")); TransferOUT += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "TransferOUT")); Damaged += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Damage")); PurReturn += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "ReturnToSupplier")); Deviation += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Deviation")); SystemClosing += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "SystemClosing")); ActualClosing += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "ActualClosing")); SystemAmount += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "SystemAmount")); ActualAmount += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "ActualAmount")); UNITActualAmount += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "STOCKINHANDWITHUNITCONVERTSYSTEM")); UNITOutwardReturn += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "STOCKINHANDWITHUNITCONVERTACTUAL")); } if (e.Row.RowType == DataControlRowType.Footer) { e.Row.Cells[6].Text = "Total"; e.Row.Cells[7].Text = SystemOpening.ToString("0.00"); e.Row.Cells[8].Text = ActualOpening.ToString("0.00"); e.Row.Cells[9].Text = Purchase.ToString("0.00"); e.Row.Cells[11].Text = Sales.ToString("0.00"); e.Row.Cells[12].Text = SalesReturn.ToString("0.00"); e.Row.Cells[13].Text = Inward.ToString("0.00"); e.Row.Cells[14].Text = Outward.ToString("0.00"); e.Row.Cells[15].Text = OutwardReturn.ToString("0.00"); e.Row.Cells[16].Text = TransferIN.ToString("0.00"); e.Row.Cells[17].Text = TransferOUT.ToString("0.00"); e.Row.Cells[18].Text = Damaged.ToString("0.00"); e.Row.Cells[10].Text = PurReturn.ToString("0.00"); e.Row.Cells[19].Text = Deviation.ToString("0.00"); e.Row.Cells[20].Text = SystemClosing.ToString("0.00"); e.Row.Cells[21].Text = ActualClosing.ToString("0.00"); e.Row.Cells[23].Text = UNITActualAmount.ToString("0.00"); e.Row.Cells[24].Text = UNITOutwardReturn.ToString("0.00"); e.Row.Cells[25].Text = SystemAmount.ToString("0.00"); e.Row.Cells[26].Text = ActualAmount.ToString("0.00"); } } catch (Exception ex) { } }
public ActionResult Create([Bind(Include = "OutwardID,DateOfDisp,ToWhom,FileReferenceNo,FileReferenceDate,SubjectMatter,PostageDrawn,PostageExtended,Remark,RegisterTypeID")] Outward outward) { ViewBag.RegisterTypeID = outward.RegisterTypeID; if (ModelState.IsValid) { db.Outwards.Add(outward); db.SaveChanges(); return(RedirectToAction("Index", new { rt = outward.RegisterTypeID })); } return(View(outward)); }
public ActionResult Edit([Bind(Include = "OutwardID,DateOfDisp,ToWhom,FileReferenceNo,FileReferenceDate,SubjectMatter,PostageDrawn,PostageExtended,Remark,RegisterTypeID")] Outward outward) { ViewBag.RegisterTypeID = outward.RegisterTypeID; if (ModelState.IsValid) { db.Entry(outward).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index", new { rt = outward.RegisterTypeID })); } ViewBag.RegisterTypeID = new SelectList(db.RegisterTypes, "RegisterTypeID", "RegisterType1", outward.RegisterTypeID); return(View(outward)); }
// GET: Outwards/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Outward outward = db.Outwards.Find(id); if (outward == null) { return(HttpNotFound()); } return(View(outward)); }
// GET: Outwards/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Outward outward = db.Outwards.Find(id); ViewBag.RegisterTypeID = outward.RegisterTypeID; if (outward == null) { return(HttpNotFound()); } return(View(outward)); }
//PUT: api/Unit/5 public ServerResponse Put([FromBody] Outward Outward) { var res = new ServerResponse(); using (OutwardBL OutwardBL = new OutwardBL()) { try { res.Data = OutwardBL.UpdateOutward(Outward); } catch (Exception ex) { res.Success = false; } } return(res); }
protected void GrdReport_RowDataBound(object sender, GridViewRowEventArgs e) { try { if (e.Row.RowType == DataControlRowType.DataRow) { Opening += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Opening")); Purchase += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Purchase")); Sales += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Sales")); SalesReturn += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "SalesReturn")); Inward += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Inward")); Outward += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Outward")); OutwardReturn += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "OutwardReturn")); TransferIN += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "TransferIN")); TransferOUT += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "TransferOUT")); Damaged += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Damage")); PurReturn += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "ReturnToSupplier")); Closing += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Closing")); Amount += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Amount")); Consumption += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Consumption")); } if (e.Row.RowType == DataControlRowType.Footer) { e.Row.Cells[6].Text = "Total"; e.Row.Cells[7].Text = Opening.ToString("0.00"); e.Row.Cells[8].Text = Purchase.ToString("0.00"); e.Row.Cells[9].Text = Sales.ToString("0.00"); e.Row.Cells[10].Text = SalesReturn.ToString("0.00"); e.Row.Cells[12].Text = Inward.ToString("0.00"); e.Row.Cells[13].Text = Outward.ToString("0.00"); e.Row.Cells[14].Text = OutwardReturn.ToString("0.00"); e.Row.Cells[16].Text = TransferIN.ToString("0.00"); e.Row.Cells[17].Text = TransferOUT.ToString("0.00"); e.Row.Cells[15].Text = Damaged.ToString("0.00"); e.Row.Cells[11].Text = PurReturn.ToString("0.00"); e.Row.Cells[19].Text = Closing.ToString("0.00"); e.Row.Cells[20].Text = Amount.ToString("0.00"); e.Row.Cells[18].Text = Consumption.ToString("0.00"); } } catch (Exception ex) { } }
public IEnumerable <Outward> GetDataByQueryCondition(QueryCondition queryCondition) { var storedProcedure = "Proc_Outward_GetByCondition"; var parameter = new Hashtable(); if (queryCondition.ShopID == null) { parameter.Add("ShopID", DBNull.Value); } else { parameter.Add("ShopID", queryCondition.ShopID); } parameter.Add("StartDate", queryCondition.StartDate.ToLocalTime()); parameter.Add("EndDate", queryCondition.EndDate.ToLocalTime()); using (DataAccess dataAccess = new DataAccess()) { SqlDataReader dataReader = dataAccess.ExecuteReader(storedProcedure, parameter); while (dataReader.Read()) { var item = new Outward(); for (int i = 0; i < dataReader.FieldCount; i++) { var fieldTableName = dataReader.GetName(i); var fieldTableValue = dataReader.GetValue(i); var property = item.GetType().GetProperty(fieldTableName); if (property != null && fieldTableValue != DBNull.Value) { property.SetValue(item, fieldTableValue); } } yield return(item); } } }
public Outward UpdateOutward(Outward Outward) { var result = this.UpdateEntity <Outward>(Outward); return(result); }