Exemplo n.º 1
0
        public JsonResult SaveModulesProduct(string modulesProduct)
        {
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            ModulesProduct       model      = serializer.Deserialize <ModulesProduct>(modulesProduct);

            bool flag = false;

            if (model.AutoID == 0)
            {
                model.CreateUserID = string.Empty;
                flag = ModulesProductBusiness.InsertModulesProduct(model);
            }
            else
            {
                model.CreateUserID = string.Empty;
                flag = ModulesProductBusiness.UpdateModulesProduct(model);
            }
            JsonDictionary.Add("Result", flag ? 1 : 0);

            return(new JsonResult()
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Exemplo n.º 2
0
        public static ModulesProduct GetModulesProductDetail(int id)
        {
            ModulesProduct model = new ModulesProduct();

            DataTable dt = ModulesProductDAL.BaseProvider.GetModulesProductDetail(id);

            model.FillData(dt.Rows[0]);

            return(model);
        }
Exemplo n.º 3
0
        public static List <ModulesProduct> GetModulesProducts(string keyWords, int pageSize, int pageIndex, ref int totalCount, ref int pageCount)
        {
            DataTable             dt   = CommonBusiness.GetPagerData("ModulesProduct as p,Modules as m ", " p.*,m.name ", " p.ModulesID=m.ModulesID and p.Status<>9 ", "p.AutoID", pageSize, pageIndex, out totalCount, out pageCount);
            List <ModulesProduct> list = new List <ModulesProduct>();
            ModulesProduct        model;

            foreach (DataRow item in dt.Rows)
            {
                model = new ModulesProduct();
                model.FillData(item);
                list.Add(model);
            }

            return(list);
        }
Exemplo n.º 4
0
        public static List <ModulesProduct> GetModulesProducts(string keyWords, int pageSize, int pageIndex, ref int totalCount, ref int pageCount)
        {
            string sqlWhere = "p.Status<>9 ";

            DataTable             dt   = CommonBusiness.GetPagerData("ModulesProduct as p", " p.*", sqlWhere, "p.AutoID", " p.UserQuantity asc,p.PeriodQuantity asc", pageSize, pageIndex, out totalCount, out pageCount);
            List <ModulesProduct> list = new List <ModulesProduct>();
            ModulesProduct        model;

            foreach (DataRow item in dt.Rows)
            {
                model = new ModulesProduct();
                model.FillData(item);
                list.Add(model);
            }

            return(list);
        }
Exemplo n.º 5
0
 public static bool InsertModulesProduct(ModulesProduct model)
 {
     return(ModulesProductDAL.BaseProvider.InsertModulesProduct(model.ModulesID, model.Period, model.PeriodQuantity, model.UserQuantity,
                                                                model.Price, model.Description, model.Type, model.IsChild, model.CreateUserID));
 }
Exemplo n.º 6
0
 public static bool UpdateModulesProduct(ModulesProduct model)
 {
     return(ModulesProductDAL.BaseProvider.UpdateModulesProduct(model.AutoID, model.ModulesID, model.Period, model.PeriodQuantity, model.UserQuantity,
                                                                model.Price, model.Description, model.Type, model.IsChild));
 }