public JsonResult GetPODetailItem(int POID, DataSourceRequest request) { KoyoSMS.WCF.Common.Model.PageBase pageCondition = new KoyoSMS.WCF.Common.Model.PageBase(); int page = request.Page; int pageSize = request.PageSize; int iPOID = POID > 0 ? POID : 0; SQLQueryBuilder queryBuilder = new SQLQueryBuilder(); DBPOProfile poProfile = new DBPOProfile(); if (iPOID > 0) { queryBuilder.QueryParameters.Add(new SQLQueryParameter("POID", iPOID)); } pageCondition.PageIndex = page - 1; pageCondition.PageSize = pageSize > 0 ? pageSize : 5; poCollection.PODetailViewItems = poProfile.GetPODetailViews(queryBuilder, pageCondition); int total = pageCondition.TotalRecord; var jsonData = new { total = total, data = poCollection.PODetailViewItems }; return(Json(jsonData, JsonRequestBehavior.AllowGet)); }
public JsonResult GetSupplierItemsList(int ProjectID) { string strProjectID;//= string.IsNullOrEmpty(collection["ProjectID"]) ? collection["ProjectID"] : "0"; //if (collection["ProjectID"] == "") // strProjectID = "0"; //else strProjectID = collection["ProjectID"]; //int projectID = Convert.ToInt32(strProjectID); int projectID = ProjectID > 0 ? ProjectID : 0; DBPOProfile poProfile = new DBPOProfile(); SQLQueryBuilder queryBuilder = new SQLQueryBuilder(); queryBuilder.QueryParameters.Add(new SQLQueryParameter("ProjectID", projectID)); var SupplierID = poProfile.GetSupplierDDLItem(queryBuilder); List <SelectListItem> item = (from a in SupplierID select new SelectListItem() { Text = a.SupplierOrgSN, Value = a.SupplierID.ToString() }).Distinct().ToList(); item.Insert(0, new SelectListItem() { Text = "Select All", Value = "0" }); return(Json(item)); }
public ActionResult DoPOProfileAction(POEntity item) { DateTime today = DateTime.Now; POEntity currentItem = UtilityModelClass.Models.Utility.CopyShadow <POEntity>(item); currentItem.CreateDate = (item.CreateDate); currentItem.UpdateDate = today; currentItem.UserID = 1; DBPOProfile poProfile = new DBPOProfile(); if (currentItem.POID > 0) { poProfile.DoPOProfileAction(enumActionItem.Edit, currentItem); } else { poProfile.DoPOProfileAction(enumActionItem.Insert, currentItem); } var jsonData = item; return(Json(jsonData, JsonRequestBehavior.AllowGet)); }
public JsonResult GetProjectItemsList(int MasterID) { //string strMasterID;// = collection["MasterID"];//== "" ? collection["MasterID"] : "0"; //if (collection["MasterID"] == "") // strMasterID = "0"; //else strMasterID = collection["MasterID"]; //int MasterID = Convert.ToInt32(strMasterID); int masterID = MasterID > 0 ? MasterID : 0; DBPOProfile poProfile = new DBPOProfile(); SQLQueryBuilder queryBuilder = new SQLQueryBuilder(); queryBuilder.QueryParameters.Add(new SQLQueryParameter("MasterID", masterID)); var ProjectID = poProfile.GetProjectDDLItem(queryBuilder); List <SelectListItem> item = (from a in ProjectID select new SelectListItem() { Text = a.ProjectName, Value = a.ProjectID.ToString() }).Distinct().ToList(); item.Insert(0, new SelectListItem() { Text = "Select All", Value = "0", Selected = true }); return(Json(item)); }
public ActionResult GetFormLoadData() { DBPOProfile poProfile = new DBPOProfile(); poCollection.MasterItems = poProfile.GetMasterItems(); poCollection.ProjectItems = poProfile.GetProjectItems(); poCollection.PONo = poProfile.GetPONoItems(); var jsonData = new { MasterItems = poCollection.MasterItems, ProjectItems = poCollection.ProjectItems, PONoitems = poCollection.PONo }; return(Json(jsonData, JsonRequestBehavior.AllowGet)); }
public JsonResult GetSupplieItemsListNoLimits(FormCollection collection) { DBPOProfile poProfile = new DBPOProfile(); SQLQueryBuilder queryBuilder = new SQLQueryBuilder(); var ProjectItems = poProfile.GetMasterDDLItem(queryBuilder); List <SelectListItem> item = (from a in ProjectItems select new SelectListItem() { Text = a.OrgSN, Value = a.MasterID.ToString() }).Distinct().ToList(); item.Insert(0, new SelectListItem() { Text = "Select All", Value = "0", Selected = true }); return(Json(item)); }
public JsonResult GetPOViewItems(int MasterID, int ProjectID, int SupplierID, string PONo, DataSourceRequest request) { int masterID = MasterID > 0 ? MasterID : 0; int projectID = ProjectID > 0 ? ProjectID : 0; string pono = !string.IsNullOrEmpty(PONo) ? PONo : ""; int page = request.Page; int pageSize = request.PageSize; SQLQueryBuilder queryBuilder = new SQLQueryBuilder(); KoyoSMS.WCF.Common.Model.PageBase pageCondition = new KoyoSMS.WCF.Common.Model.PageBase(); DBPOProfile poProfile = new DBPOProfile(); if (masterID > 0) { queryBuilder.QueryParameters.Add(new SQLQueryParameter("MasterID", masterID)); } if (projectID > 0) { queryBuilder.QueryParameters.Add(new SQLQueryParameter("ProjectID", projectID)); } if (!string.IsNullOrEmpty(pono)) { queryBuilder.QueryParameters.Add(new SQLQueryParameter("PONo", pono)); } pageCondition.PageIndex = page - 1; pageCondition.PageSize = pageSize > 0 ? pageSize : 5; poCollection.POEntityViewItems = poProfile.GetPOViews(queryBuilder, pageCondition); int total = pageCondition.TotalRecord; var jsonData = new { total = total, data = poCollection.POEntityViewItems }; return(Json(jsonData, JsonRequestBehavior.AllowGet)); }
public JsonResult GetMasterItemsList() { DBPOProfile poProfile = new DBPOProfile(); SQLQueryBuilder queryBuilder = new SQLQueryBuilder(); var MasterItems = poProfile.GetMasterDDLItem(queryBuilder); List <SelectListItem> item = (from a in MasterItems select new SelectListItem() { Text = a.OrgSN, Value = a.MasterID.ToString() }).Distinct().ToList(); item.Insert(0, new SelectListItem() { Text = "Select All", Value = "0", Selected = true }); var data = new { data = item }; return(Json(item)); }