예제 #1
0
        public bool exist(int groupid, int moduleid, int menuid)
        {
            string sql  = "select 1 from BaseGroupMenu where groupid =" + groupid + " and moduleid = " + moduleid + " and menuid = " + menuid;
            int    rows = dbc.ExecuteSelect(sql);

            return(rows == 1);
        }
예제 #2
0
        public int tb_WareHouseAdd(tb_WareHouse good)
        {
            int intFalg = 0;

            try
            {
                string str_Add = "insert into tb_WareHouse(WareID,WareName,Remark) values( ";
                str_Add += " '" + good.strWareID + "','" + good.strWareName + "','" + good.strRemark + "')";
                string sql = "select Count(1) from tb_WareHouse where WareID='" + good.strWareID + "'";
                //SqlCommand cmd1 = new SqlCommand(sql, conn);
                int count = dbc.ExecuteSelect(sql);
                if (count > 0)
                {
                    MessageUtil.ShowError("仓库编号已存在!");
                    return(0);
                }
                else
                {
                    intFalg = dbc.ExeInfochange(str_Add);
                    return(intFalg);
                }
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.ToString());
                return(intFalg);
            }
        }
예제 #3
0
        public int tb_EmpInfoAdd(tb_EmpInfo Empinfo)
        {
            int intFalg = 0;

            try
            {
                string str_Add = "insert into tb_EmpInfo values( ";
                str_Add += " '" + Empinfo.strEmpId + "','" + Empinfo.strEmpName + "',";
                str_Add += " '" + Empinfo.strEmpLoginPwd + "',";
                str_Add += " '" + Empinfo.strEmpDept + "','" + Empinfo.strEmpPost + "'," + " '" + Empinfo.strEmpPhone + "'," + Empinfo.intEmpFalg + ",1,null," + Empinfo.intEmpGroupID;
                str_Add += ", '" + Empinfo.strEmpKilnNO + "','" + Empinfo.strEmpWorshoId + "')";

                string sql = "select Count(1) from tb_EmpInfo where EmpId='" + Empinfo.strEmpId + "'";
                //SqlCommand cmd1 = new SqlCommand(sql, conn);
                int count = dbl.ExecuteSelect(sql);
                if (count > 0)
                {
                    MessageUtil.ShowError("该员工已存在!");
                    return(0);
                }
                else
                {
                    intFalg = dbl.ExeInfochange(str_Add);
                    return(intFalg);
                }
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.ToString());
                return(intFalg);
            }
        }
예제 #4
0
        public int tb_ModelInfoAdd(
            tb_ModelInfo good
            )
        {
            int intFalg = 0;

            try
            {
                string str_Add = @"INSERT INTO [dbo].[tb_ModelInfo]
                                   ([ModelNo]
                                   ,[ModelName]
                                   ,[FCreater]
                                   ,[FCreateDate]
                                   ,[FModifier]
                                   ,[FModifydate]
                                   ,[FImagePath]
                                   ,[FTypeSteps1]
                                   ,[FTypeSteps2]
                                   ,[FTypeSteps3]
                                   ,[FIsStop]
                                   ,FMaterialQty)
                             VALUES (";
                str_Add += " '" + good.strModelNo + "','" + good.strModelName + "',";
                str_Add += " '" + good.strFCreater + "',";
                str_Add += " '" + good.dFCreateDate + "','" + good.strFModifier + "','" + good.dFModifydate + "','" + good.strFImagePath + "',";
                str_Add += "'" + good.strFTypeSteps1 + "','" + good.strFTypeSteps2 + "','" + good.strFTypeSteps3 + "'," + good.iFIsStop + ",'" + good.strFMaterialQty + "')";
                string sql = "select Count(1) from tb_ModelInfo where ModelNo='" + good.strModelNo + "'";
                //SqlCommand cmd1 = new SqlCommand(sql, conn);
                int count = dbc.ExecuteSelect(sql);
                if (count > 0)
                {
                    MessageUtil.ShowError("器型编号已存在!");
                    return(0);
                }
                else
                {
                    intFalg = dbc.ExeInfochange(str_Add);
                    //}
                    return(intFalg);
                }
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.ToString());
                return(intFalg);
            }
        }
예제 #5
0
        public int tb_GoodsInfoAdd(
            tb_GoodsInfo good
            )
        {
            int intFalg = 0;

            try
            {
                /* if (ishaspics)
                 * {
                 *   string str_Add = "insert into tb_GoodsInfo(GoodId,GoodName,ItemNO,ModelNO,GoodMaterial,FCreater,FCreateDate,fImage) values( ";
                 *   str_Add += " '" + good.strGoodsId + "','" + good.strGoodsName + "',";
                 *   str_Add += " '" + good.strItemNO + "',";
                 *   str_Add += " '" + good.strModelNO + "','" + good.strGoodMaterial + "','" + good.strFCreater + "','" + good.dFCreateDate + "',@img )";
                 *   intFalg = dbc.ExeInfochange(str_Add, "@img", good.image);
                 * }
                 * else
                 * {
                 */
                string str_Add = "insert into tb_GoodsInfo(GoodId,GoodName,ItemNO,ModelNO,GoodMaterial,FCreater,FCreateDate,FImagePath) values( ";
                str_Add += " '" + good.strGoodsId + "','" + good.strGoodsName + "',";
                str_Add += " '" + good.strItemNO + "',";
                str_Add += " '" + good.strModelNO + "','" + good.strGoodMaterial + "','" + good.strFCreater + "','" + good.dFCreateDate + "','" + good.strFImagePath + "')";;
                //str_Add += " '" + good.strFColor + "','" + good.strFTypeSteps1 + "','" + good.strFTypeSteps2 + "','" + good.strFTypeSteps3 + "','" + good.strFColorSteps + "'," + good.iFIsStop+
                string sql = "select Count(1) from tb_GoodsInfo where GoodId='" + good.strGoodsId + "'";
                //SqlCommand cmd1 = new SqlCommand(sql, conn);
                int count = dbc.ExecuteSelect(sql);
                if (count > 0)
                {
                    MessageUtil.ShowError("产品编号已存在!");
                    return(0);
                }
                else
                {
                    intFalg = dbc.ExeInfochange(str_Add);
                    //}
                    return(intFalg);
                }
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.ToString());
                return(intFalg);
            }
        }
예제 #6
0
        public int tb_BaseAdd(
            tb_Base good
            )
        {
            int intFalg = 0;

            try
            {
                /* if (ishaspics)
                 * {
                 *   string str_Add = "insert into tb_BaseInfo(GoodId,GoodName,ItemNO,ModelNO,GoodMaterial,FCreater,FCreateDate,fImage) values( ";
                 *   str_Add += " '" + good.strGoodsId + "','" + good.strGoodsName + "',";
                 *   str_Add += " '" + good.strItemNO + "',";
                 *   str_Add += " '" + good.strModelNO + "','" + good.strGoodMaterial + "','" + good.strFCreater + "','" + good.dFCreateDate + "',@img )";
                 *   intFalg = dbc.ExeInfochange(str_Add, "@img", good.image);
                 * }
                 * else
                 * {
                 */
                string str_Add = "insert into tb_Base(FClass,FBaseID,FBaseName,FRemark) values( ";
                str_Add += " '" + good.strFClass + "','" + good.strFBaseID + "',";
                str_Add += " '" + good.strFBaseName + "',";
                str_Add += " '" + good.strFRemark + "')";
                string sql = "select Count(1) from tb_Base where FBaseID='" + good.strFBaseID + "'";
                //SqlCommand cmd1 = new SqlCommand(sql, conn);
                int count = dbc.ExecuteSelect(sql);
                if (count > 0)
                {
                    MessageUtil.ShowError("编号已存在!");
                    return(0);
                }
                else
                {
                    intFalg = dbc.ExeInfochange(str_Add);
                    //}
                    return(intFalg);
                }
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.ToString());
                return(intFalg);
            }
        }
예제 #7
0
        public int tb_ColorInfoAdd(
            tb_ColorInfo good
            )
        {
            int intFalg = 0;

            try
            {
                string str_Add = @"INSERT INTO [dbo].[tb_ColorInfo]
                                   ([ColorNo]
                                   ,[ColorName]
                                   ,[FCreater]
                                   ,[FCreateDate]
                                   ,[FModifier]
                                   ,[FModifydate]
                                   ,[FColorSteps]
                                   ,[FIsStop])
                             VALUES(";
                str_Add += " '" + good.strColorNo + "','" + good.strColorName + "',";
                str_Add += " '" + good.strFCreater + "',";
                str_Add += " '" + good.dFCreateDate + "','" + good.strFModifier + "','" + good.dFModifydate + "',";
                str_Add += "'" + good.strFColorSteps + "'," + good.iFIsStop + ")";
                string sql = "select Count(1) from tb_ColorInfo where ColorNo='" + good.strColorNo + "'";
                //SqlCommand cmd1 = new SqlCommand(sql, conn);
                int count = dbc.ExecuteSelect(sql);
                if (count > 0)
                {
                    MessageUtil.ShowError("花色编号已存在!");
                    return(0);
                }
                else
                {
                    intFalg = dbc.ExeInfochange(str_Add);
                    //}
                    return(intFalg);
                }
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.ToString());
                return(intFalg);
            }
        }