예제 #1
0
        private bool ExitsNum(string num)
        {
            EtNet_BLL.ProductManager productTypeBLL = new EtNet_BLL.ProductManager();
            DataTable dt = productTypeBLL.GetList(string.Format("ProdNo = '{0}'", num));

            return(dt.Rows.Count > 0 ? true : false);
        }
예제 #2
0
        //添加项目
        private bool AddProd(string typeID)
        {
            EtNet_BLL.ProductManager proBLL   = new EtNet_BLL.ProductManager();
            EtNet_Models.Product     proModel = new EtNet_Models.Product();

            proModel.Brief      = hidHtml.Value;
            proModel.FlagMain   = chkMain.Checked;
            proModel.ProdName   = txtName.Value;
            proModel.ProdNo     = MakeNum(typeID);
            proModel.ProdTypeID = typeID;
            proModel.Remark     = txtMark.Value;
            try
            {
                if (proBLL.Add(proModel) != null)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch
            {
                return(false);
            }
        }
예제 #3
0
        private void InitData(int id)
        {
            EtNet_BLL.ProductManager proBLL   = new EtNet_BLL.ProductManager();
            EtNet_Models.Product     proModel = proBLL.GetModel(id);

            txtBrief.Value  = Server.UrlDecode(proModel.Brief);
            txtMark.Value   = proModel.Remark;
            txtName.Value   = proModel.ProdName;
            chkMain.Checked = proModel.FlagMain;

            EtNet_BLL.ProductTypeManager proType = new EtNet_BLL.ProductTypeManager();
            txtType.Value = proType.GetModel(proModel.ProdTypeID).ProdTypeName;
        }
예제 #4
0
        //添加项目
        private bool AddProd(int id)
        {
            EtNet_BLL.ProductManager proBLL   = new EtNet_BLL.ProductManager();
            EtNet_Models.Product     proModel = new EtNet_Models.Product();

            proModel = proBLL.GetModel(id);

            proModel.Brief    = hidHtml.Value;
            proModel.FlagMain = chkMain.Checked;
            proModel.ProdName = txtName.Value;
            proModel.Remark   = txtMark.Value;
            try
            {
                return(proBLL.Update(proModel));
            }
            catch
            {
                return(false);
            }
        }