public IList <QM_INFRA_CATEGORIES> GetCategoriesDatasByStatus(QM_INFRA_CATEGORIES param) { param.DataType = "不良原因"; IList <QM_INFRA_CATEGORIES> entities = qM_INFRA_CATEGORIESBO.GetByParam(param); return(entities); }
public HttpResponseMessage RemoveCategory(string pk, string user) { //return Request.CreateResponse(HttpStatusCode.OK, "删除成功"); try { QM_INFRA_CATEGORIES param = qM_INFRA_CATEGORIESBO.GetEntity(int.Parse(pk)); param.IsDeleted = true; param.Last_update_by = user; param.Last_update_date = SSGlobalConfig.Now; qM_INFRA_CATEGORIESBO.UpdateSome(param); QM_INFRA_CAUSE_CATEGORY qM_INFRA_CAUSE_CATEGORY = new QM_INFRA_CAUSE_CATEGORY() { Category = param.Category }; IList <QM_INFRA_CAUSE_CATEGORY> list = qM_INFRA_CAUSE_CATEGORYBO.GetByParam(qM_INFRA_CAUSE_CATEGORY); foreach (QM_INFRA_CAUSE_CATEGORY e in list) { qM_INFRA_CAUSE_CATEGORYBO.Delete((int)e.PK); } return(Request.CreateResponse(HttpStatusCode.OK, "删除成功")); } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "删除出错:" + ex.Message)); } }
public IList <QM_INFRA_CATEGORIES> GetCategoriesDatas() { QM_INFRA_CATEGORIES param = new QM_INFRA_CATEGORIES() { DataType = "不良原因" };//类型为不良原因分类 IList <QM_INFRA_CATEGORIES> entities = qM_INFRA_CATEGORIESBO.GetByParam(param); return(entities); }
public List <String> GetCategories() { QM_INFRA_CATEGORIES param = new QM_INFRA_CATEGORIES() { DataType = "不良原因" };//类型为不良原因分类 IList <QM_INFRA_CATEGORIES> entities = qM_INFRA_CATEGORIESBO.GetByParam(param); return(entities.Select(a => a.Category).Distinct().ToList()); }
public IList <QM_INFRA_CATEGORIES> GetCategory() { QM_INFRA_CATEGORIES param = new QM_INFRA_CATEGORIES() { DataType = "不良原因", IsDeleted = false }; return(qM_INFRA_CATEGORIESBO.GetByParam(param)); }
public IList <QM_INFRA_CATEGORIES> GetSubCategorys(string categorys) { QM_INFRA_CATEGORIES param = new QM_INFRA_CATEGORIES() { DataType = "不良现象", Category = categorys };//类型为不良现象分类 IList <QM_INFRA_CATEGORIES> entities = qM_INFRA_CATEGORIESBO.GetByParam(param); return(entities); }
public HttpResponseMessage RecoverCategory(string pk, string user) { //return Request.CreateResponse(HttpStatusCode.OK, "删除成功"); try { QM_INFRA_CATEGORIES param = qM_INFRA_CATEGORIESBO.GetEntity(int.Parse(pk)); param.IsDeleted = false; param.Last_update_by = user; param.Last_update_date = SSGlobalConfig.Now; qM_INFRA_CATEGORIESBO.UpdateSome(param); return(Request.CreateResponse(HttpStatusCode.OK, "恢复成功")); } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "恢复出错:" + ex.Message)); } }
public HttpResponseMessage AddCategory(QM_INFRA_CATEGORIES param) { try { param.DataType = "不良原因"; IList <QM_INFRA_CATEGORIES> qM_INFRA_CATEGORIESs = qM_INFRA_CATEGORIESBO.GetByParam(param); if (qM_INFRA_CATEGORIESs.Count > 0) { return(Request.CreateResponse(HttpStatusCode.OK, "该分类已存在")); } param.Creation_date = SSGlobalConfig.Now; param.IsDeleted = false; qM_INFRA_CATEGORIESBO.Insert(param); return(Request.CreateResponse(HttpStatusCode.OK, "新增成功")); } catch { return(Request.CreateResponse(HttpStatusCode.InternalServerError, "新增失败")); } }
public HttpResponseMessage AddCategory(QM_INFRA_CATEGORIES param) { try { param.DataType = "不良现象"; //前台新增的一级分类 if (!string.IsNullOrEmpty(param.Attribute01)) { string sql = @"SELECT count(1) FROM [SitMesDbExt].[dbo].[QM_INFRA_CATEGORIES] where [Category]=N'" + param.Attribute01 + "'"; DataTable dt = bsc_bo.GetDataTableBySql(sql); int i = Convert.ToInt32(dt.Rows[0][0]); if (i > 0) { return(Request.CreateResponse(HttpStatusCode.OK, "输入的一级分类已存在,请在下拉框中选择")); } param.Category = param.Attribute01; param.Attribute01 = string.Empty; } IList <QM_INFRA_CATEGORIES> qM_INFRA_CATEGORIESs = qM_INFRA_CATEGORIESBO.GetByParam(param); if (qM_INFRA_CATEGORIESs.Count > 0) { return(Request.CreateResponse(HttpStatusCode.OK, "该分类已存在")); } param.Creation_date = SSGlobalConfig.Now; param.Last_update_date = SSGlobalConfig.Now; param.IsDeleted = false; qM_INFRA_CATEGORIESBO.Insert(param); return(Request.CreateResponse(HttpStatusCode.OK, "新增成功")); } catch { return(Request.CreateResponse(HttpStatusCode.InternalServerError, "新增失败")); } }