Ejemplo n.º 1
0
        //添加大类型
        public bool AddBigType(string bname)
        {
            BigType bt = new BigType
            {
                Id   = BackIdService <BigType> .Instance.NewId(),
                Name = bname
            };
            var r = dbm.AddBigType(bt);

            return(r);
        }
Ejemplo n.º 2
0
 public bool UpdateBigType(BigType h)
 {
     bt.SetCtx(db);
     return(bt.Update(h));
 }
Ejemplo n.º 3
0
 public bool DeleteBigType(BigType h)
 {
     bt.SetCtx(db);
     return(bt.Delete(h));
 }
Ejemplo n.º 4
0
 public bool AddBigType(BigType h)
 {
     bt.SetCtx(db);
     return(bt.Add(h));
 }
Ejemplo n.º 5
0
        /// <summary>
        /// 页面显示
        /// </summary>
        /// <returns></returns>
        public string TypeShow()
        {
            if (userInfo.User.personaId == 1)  //如果是管理员
            {
                #region 管理员
                ProductStockBLL             psb         = new ProductStockBLL();
                string                      vencode     = Request.Form["vencode"] == null ? "1" : Request.Form["vencode"].ToString();
                string                      roleId      = Request.Form["roleId"] == null ? "0" : Request.Form["roleId"].ToString();
                StringBuilder               allpage     = new StringBuilder();
                List <model.productbigtype> listBigType = psb.GetProductBigTypeVencode();
                string[]                    BigType;
                string[]                    Type = ptb.GetTypePerssoin(roleId, vencode, out BigType);
                for (int i = 0; i < listBigType.Count; i++)
                {
                    if (BigType.Contains(listBigType[i].Id.ToString()))
                    {
                        allpage.Append("<div><div style='color:blue;font-size:15px;'><input class='ckeckboxAll' checked='checked' category='BigType' type='checkbox' id='" + listBigType[i].Id + "' onchange='CheckAll(\"" + listBigType[i].Id + "\")' />" + listBigType[i].bigtypeName + "</div>");
                    }
                    else
                    {
                        allpage.Append("<div><div style='color:blue;font-size:15px;'><input class='ckeckboxAll' category='BigType' type='checkbox' id='" + listBigType[i].Id + "' onchange='CheckAll(\"" + listBigType[i].Id + "\")' />" + listBigType[i].bigtypeName + "</div>");
                    }
                    List <model.producttypeVen> list = psb.GetProductTypeVencode(vencode);
                    list = list.Where(a => a.BigId == listBigType[i].Id).ToList();
                    for (int j = 0; j < list.Count; j++)
                    {
                        if (Type.Contains(list[j].TypeNo.ToString()))
                        {
                            allpage.Append("<div style='float:left;min-width:120px'><label><input type='checkbox' checked='checked' category='Type' name='" + listBigType[i].Id + "' id='" + list[j].TypeNo + "'>" + list[j].TypeName + "</label></div>");
                        }
                        else
                        {
                            allpage.Append("<div style='float:left;min-width:120px'><label><input type='checkbox' category='Type' name='" + listBigType[i].Id + "' id='" + list[j].TypeNo + "'>" + list[j].TypeName + "</label></div>");
                        }
                    }
                    allpage.Append("</div><div style='clear:both'></div>");
                }
                return(allpage.ToString());

                #endregion
            }
            else
            {
                #region 其他角色
                ProductStockBLL             psb         = new ProductStockBLL();
                string                      vencode     = Request.Form["vencode"] == null ? "1" : Request.Form["vencode"].ToString();
                string                      roleId      = Request.Form["roleId"] == null ? "0" : Request.Form["roleId"].ToString();
                StringBuilder               allpage     = new StringBuilder();
                List <model.productbigtype> listBigType = psb.GetProductBigTypeVencode();
                string[]                    BigType;                                                          //当前角色的大类别权限
                string[]                    Type     = ptb.GetTypePerssoin(roleId, vencode, out BigType);     //当前角色的权限
                string[]                    UserType = ptb.GetTypeUser(userInfo.User.Id.ToString(), vencode); //用户自己的权限
                for (int i = 0; i < listBigType.Count; i++)
                {
                    if (BigType.Contains(listBigType[i].Id.ToString()))
                    {
                        List <model.producttypeVen> list = psb.GetProductTypeVencode(vencode, listBigType[i].Id);//通过大类别获取小类别
                        allpage.Append("<div><div style='color:blue;font-size:15px;'><input class='ckeckboxAll' checked='checked' category='BigType' type='checkbox' id='" + listBigType[i].Id + "' onchange='CheckAll(\"" + listBigType[i].Id + "\")' />" + listBigType[i].bigtypeName + "</div>");
                        for (int j = 0; j < list.Count; j++)
                        {
                            if (Type.Contains(list[j].TypeNo))
                            {
                                if (UserType.Contains(list[j].TypeNo))
                                {
                                    allpage.Append("<div style='float:left;min-width:120px'><label><input type='checkbox' checked='checked' category='Type' name='" + listBigType[i].Id + "' id='" + list[j].TypeNo + "'>" + list[j].TypeName + "</label></div>");
                                }
                                else
                                {
                                    allpage.Append("<div style='float:left;min-width:120px'><label><input type='checkbox' category='Type' name='" + listBigType[i].Id + "' id='" + list[j].TypeNo + "'>" + list[j].TypeName + "</label></div>");
                                }
                            }
                        }
                    }
                    allpage.Append("</div><div style='clear:both'></div>");
                }
                return(allpage.ToString());

                #endregion
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 大类表类型添加
        /// </summary>
        /// <returns></returns>
        public int PostBigType(BigType model)
        {
            string sql = $"insert into BigType values('{model.Btname}')";

            return(DBHelper.ExecuteNonQuery(sql));
        }