public JsonResult CountBySelection(ProductionControl productionControl) { string where = " 1=1 "; string where_MachineID = ""; string where_ProgramName = ""; string where_PdtCtrlDateTime = ""; if (!string.IsNullOrEmpty(productionControl.MachineID)) { where_MachineID = " and MachineID = '" + productionControl.MachineID + "'"; } if (!string.IsNullOrEmpty(productionControl.ProgramName)) { where_ProgramName = " and ProgramName = '" + productionControl.ProgramName + "' "; } if (productionControl.PdtCtrlDateTime != null) { where_PdtCtrlDateTime = " and PdtCtrlDateTime = '" + productionControl.PdtCtrlDateTime + "' "; } where += where_MachineID + where_ProgramName + where_PdtCtrlDateTime; return(Json(productionConTrolDB.CountBySelection(where), JsonRequestBehavior.AllowGet)); }
public JsonResult Update(ProductionControl productionControl) { return(Json(productionConTrolDB.Insert(productionControl), JsonRequestBehavior.AllowGet)); }