public ICollection <ReimbursementDetail> setObjectInforReimbursementDetail() { List <ReimbursementDetail> lst = new List <ReimbursementDetail>(); ReimbursementDetail _objReimbursementDetail = null; for (int i = 0; i < gdvExpenceDetail.Rows.Count; i++) { Label lblDate = (Label)gdvExpenceDetail.Rows[i].FindControl("lblDate"); Label lblDescription = (Label)gdvExpenceDetail.Rows[i].FindControl("lblDescription"); Label lblCategory = (Label)gdvExpenceDetail.Rows[i].FindControl("lblCategory"); Label lblCost = (Label)gdvExpenceDetail.Rows[i].FindControl("lblCost"); _objReimbursementDetail = new ReimbursementDetail(); _objReimbursementDetail.ReimbursementDate = lblDate.Text; _objReimbursementDetail.ReimbursementDescription = lblDescription.Text; _objReimbursementDetail.Category = lblCategory.Text; _objReimbursementDetail.Cost = lblCost.Text; _objReimbursementDetail.CreatedBy = Session["LoginId"].ToString(); _objReimbursementDetail.ModifiedBy = Session["LoginId"].ToString(); _objReimbursementDetail.CreatedDate = DateTime.Now.ToString(); _objReimbursementDetail.ModifiedDate = DateTime.Now.ToString(); lst.Add(_objReimbursementDetail); } return(lst); }
public ActionResult Edit(int id, FormCollection collection) { try { // TODO: Add update logic here var model = ReimbursementDetail.GetById(id); TryUpdateModel(model); model.SaveOrUpDate(); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Create(FormCollection collection) { try { // TODO: Add insert logic here var model = new ReimbursementDetail(); TryUpdateModel(model); model.Insert(); return(RedirectToAction("Index")); } catch { return(View()); } }
public ICollection <ReimbursementDetail> setObjectInforReimbursementDetail() { List <ReimbursementDetail> lst = new List <ReimbursementDetail>(); ReimbursementDetail _objReimbursementDetail = null; for (int i = 0; i < gv_ReImbrustment.Rows.Count; i++) { RadioButtonList rdo_approved = (RadioButtonList)gv_ReImbrustment.Rows[i].FindControl("rdo_approved"); HiddenField hdn_ReimbursementId = (HiddenField)gv_ReImbrustment.Rows[i].FindControl("hdn_ReimbursementId"); if (rdo_approved.SelectedValue.ToString() != "") { _objReimbursementDetail = new ReimbursementDetail(); _objReimbursementDetail.IsApprove = Convert.ToInt32(rdo_approved.SelectedValue.ToString()); _objReimbursementDetail.ReimbursementDetailId = Convert.ToInt32(hdn_ReimbursementId.Value); _objReimbursementDetail.ApprovedBy = Session["LoginId"].ToString(); _objReimbursementDetail.ModifiedBy = Session["LoginId"].ToString(); _objReimbursementDetail.ApprovedDate = DateTime.Now.ToString(); _objReimbursementDetail.ModifiedDate = DateTime.Now.ToString(); lst.Add(_objReimbursementDetail); } } return(lst); }
// GET: ReimbursementDetail/Edit/5 public ActionResult Edit(int id) { return(View(ReimbursementDetail.GetById(id))); }
// GET: ReimbursementDetail public ActionResult Index() { return(View(ReimbursementDetail.GetAll())); }