public JsonResult GetQueryData() { List <InputMasterItemTreatmentInqModel> ls = new List <InputMasterItemTreatmentInqModel>(); string _itemGroup = string.Empty; string _itemCode = string.Empty; string _type = string.Empty; string _custGroup = string.Empty; if (Request["itemGrp"] != null) { _itemGroup = Request["itemGrp"].ToString(); } if (Request["itemCd"] != null) { _itemCode = Request["itemCd"].ToString(); } if (Request["Type"] != null) { _type = Request["Type"].ToString(); } if (Request["Customer"] != null) { _custGroup = Request["Customer"].ToString(); } ls = new InputMasterItemTreatmentBLL().InquiryData(_itemCode, _itemGroup, _type, _custGroup); var JsonResult = Json(new { Data = ls }, JsonRequestBehavior.AllowGet); JsonResult.MaxJsonLength = Int32.MaxValue; return(JsonResult); }
public JsonResult DeleteItem(string id) { string _status = "success"; int result = 0; try { result = new InputMasterItemTreatmentBLL().DeleteData(id); } catch (Exception ex) { _status = ex.Message; } if (result > 0) { _status += " remove " + result + " item"; } else { _status = "Transaction failed"; } return(Json(new { Status = _status }, JsonRequestBehavior.AllowGet)); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { string[] arr_param = { }; if (Request.QueryString["param"] != null) { arr_param = Request.QueryString["param"].ToString().Split('|'); List <InputMasterItemTreatmentInqModel> ls = new List <InputMasterItemTreatmentInqModel>(); ls = new InputMasterItemTreatmentBLL().InquiryData(arr_param[0], arr_param[1], arr_param[2], arr_param[3]); DataTable dt = MNJvWeb.Models.ObjectConverter.ToDataTable <InputMasterItemTreatmentInqModel>(ls); this.ReportViewer1.Reset(); ReportDataSource rds = new ReportDataSource("DSItemMstPrd", dt); this.ReportViewer1.LocalReport.ReportEmbeddedResource = "MNJvWeb.Reporting.ItemMstProductTreatment.rdlc"; this.ReportViewer1.LocalReport.DataSources.Add(rds); this.ReportViewer1.LocalReport.Refresh(); this.ReportViewer1.Visible = true; } } }
public JsonResult Add() { string _status = "success"; int resultAffected = 0; string _group = string.Empty; string _itemCode = string.Empty; string _harga = string.Empty; string _type = string.Empty; string _custGroup = string.Empty; string _itemNm = string.Empty; string _uom = string.Empty; if (Request["itemGrp"] != null) { _group = Request["itemGrp"].ToString(); } if (Request["Type"] != null) { _type = Request["Type"].ToString(); } if (Request["Customer"] != null) { _custGroup = Request["Customer"].ToString(); } if (Request["itemNm"] != null) { _itemNm = Request["itemNm"].ToString(); } if (Request["Harga"] != null) { _harga = Request["Harga"].ToString(); } if (Request["Uom"] != null) { _uom = Request["Uom"].ToString(); } try { resultAffected = new InputMasterItemTreatmentBLL().InsertData(_itemCode, _itemNm, _harga, _uom, _group, _custGroup, _type); if (resultAffected <= 0) { _status = "transaction failed"; } } catch (Exception ex) { _status = "an error occured. " + ex.Message; } return(Json(new { Status = _status }, JsonRequestBehavior.AllowGet)); }
public JsonResult GetItemById(string id) { string _status = "success"; SPA02MTModel objItem = new SPA02MTModel(); if (id != "") { objItem = new InputMasterItemTreatmentBLL().FindById(id); } return(Json(new { Status = _status, Item_CD = objItem.ITEM_CD, Item_NM = objItem.ITEM_NM, Group = objItem.GROUP_CD, Customer = objItem.VISIT_GRP, Type_CD = objItem.TYPE_CD, Harga = objItem.HARGA, Uom = objItem.UNIT_QTY }, JsonRequestBehavior.AllowGet)); }