public JsonResult Ajax_Reject_Adjustment_ID(ajax_model ajax_data) { using (var db = new DataBaseContext()) { int adjust_id = Int32.Parse(ajax_data.name); adjustment_voucher adjust_obj = db.adjustment_voucher_repository.Where(x => x.adjustment_voucherId == adjust_id).FirstOrDefault(); adjust_obj.status = "Rejected_by_Manager"; db.SaveChanges(); } object reply_to_client = new { key_itemname_lis = "SUCCESS", }; return(Json(reply_to_client, JsonRequestBehavior.AllowGet)); }
public ActionResult Create_Adjustment_Voucher(FormCollection form_data) { string item_description = form_data["item_code_list"]; string quantity_bx = form_data["quantity_bx"]; string reason = form_data["adjustment_reason"]; using (var db = new DataBaseContext()) { item item_obj = db.item_repository.Where(x => x.item_description == item_description).FirstOrDefault(); if (item_obj != null) { adjustment_voucher adjustment_voucher_obj = new adjustment_voucher(item_obj, Int32.Parse(quantity_bx), reason, DateTime.Now.ToString(), "Added_by_Clerk"); db.adjustment_voucher_repository.Add(adjustment_voucher_obj); db.SaveChanges(); } } return(RedirectToAction("View_Adjustment_Voucher", "Clerk")); }