コード例 #1
0
        /// <summary>
        /// 查询产品配置表明细
        /// </summary>
        /// <param name="SQLCommand"></param>
        /// <returns></returns>
        public List <ProductSet_New> selectProductSet_NewDal(string SQLCommand)
        {
            string sql = SQLhelp.GetSQLCommand(SQLCommand);

            List <ProductSet_New> list = new List <ProductSet_New>();

            try
            {
                using (SqlDataReader reader = SQLhelp.ExecuteReader(sql, CommandType.Text))
                {
                    if (reader.HasRows)
                    {
                        while (reader.Read())
                        {
                            list.Add(new ProductSet_New()
                            {
                                ProductClass       = reader.GetString(0),
                                Stations           = reader.GetString(1),
                                EfficiencyQuantity = reader.IsDBNull(2)?"0":reader.GetString(2),
                                TheNumberOf        = reader.IsDBNull(3)?"0":reader.GetString(3),
                                UpdateTime         = reader.GetDateTime(4)
                            });
                        }
                    }
                    return(list);
                }
            }
            catch
            {
                throw;
            }
        }
コード例 #2
0
        /// <summary>
        /// 根据公司名查找工位
        /// </summary>
        /// <param name="SQLCommand"></param>
        /// <returns></returns>
        public List <string> selectProductionTypeOnWorkTimeTypeDal(string OnWorkTimeType, string SQLCommand)
        {
            string        sql  = SQLhelp.GetSQLCommand(SQLCommand);
            List <string> list = new List <string>();

            SqlParameter[] pms = new SqlParameter[] {
                new SqlParameter("@OnWorkTimeType", SqlDbType.VarChar, 50)
                {
                    Value = OnWorkTimeType
                }
            };
            try
            {
                using (SqlDataReader reader = SQLhelp.ExecuteReader(sql, CommandType.Text, pms))
                {
                    if (reader.HasRows)
                    {
                        while (reader.Read())
                        {
                            list.Add(reader.GetString(0));
                        }
                    }
                    return(list);
                }
            }
            catch
            {
                throw;
            }
        }
コード例 #3
0
        /// <summary>
        /// 查询工位表
        /// </summary>
        /// <param name="SQLCommand"></param>
        /// <returns></returns>
        public List <ProductionType> selectProductionTypeDal(string SQLCommand)
        {
            string sql = SQLhelp.GetSQLCommand(SQLCommand);
            List <ProductionType> list = new List <ProductionType>();

            try
            {
                using (SqlDataReader reader = SQLhelp.ExecuteReader(sql, CommandType.Text))
                {
                    if (reader.HasRows)
                    {
                        while (reader.Read())
                        {
                            list.Add(new ProductionType()
                            {
                                ProductType         = reader.GetString(0).Trim(),
                                Command             = reader.IsDBNull(1) ? "" : reader.GetString(1),
                                Command1            = reader.IsDBNull(2) ? "" : reader.GetString(2),
                                Command2            = reader.IsDBNull(3)?"":reader.GetString(3),
                                OnWorkTimeType      = reader.IsDBNull(4)?"":reader.GetString(4),
                                Command3            = reader.IsDBNull(5)?"":reader.GetString(5),
                                OnWorkTimeTypeNight = reader.IsDBNull(6)?"":reader.GetString(6)
                            });
                        }
                    }
                    return(list);
                }
            }
            catch
            {
                throw;
            }
        }
コード例 #4
0
        public List <ProductionLinePC_title> selectProductionLinePC_titleDal(string SQLCommand)
        {
            string sql = SQLhelp.GetSQLCommand(SQLCommand);
            List <ProductionLinePC_title> list = new List <ProductionLinePC_title>();

            try
            {
                using (SqlDataReader reader = SQLhelp.ExecuteReader(sql, CommandType.Text))
                {
                    if (reader.HasRows)
                    {
                        while (reader.Read())
                        {
                            list.Add(new ProductionLinePC_title()
                            {
                                CompanyName = reader.IsDBNull(1) ? "" : reader.GetString(1),
                                LineName    = reader.IsDBNull(0) ? "" : reader.GetString(0)
                            });
                        }
                    }
                    return(list);
                }
            }
            catch
            {
                throw;
            }
        }
コード例 #5
0
ファイル: UsersDal.cs プロジェクト: return001/MES_BM_GCE
 public List<Users> selectPUsersDal(string SQLCommand)
 {
     string sql = SQLhelp.GetSQLCommand(SQLCommand);
     List<Users> list = new List<Users>();
     try
     {
         using (SqlDataReader reader = SQLhelp.ExecuteReader(sql, CommandType.Text))
         {
             if (reader.HasRows)
             {
                 while (reader.Read())
                 {
                     list.Add(new Users()
                     {
                         UserName=reader.GetString(0),
                         UserPassword=reader.GetString(1),
                         systemAdimin=reader.GetBoolean(2),
                         Limite=reader.GetBoolean(3),
                         Department=reader.IsDBNull(4)?"":reader.GetString(4),
                         AddUser=reader.GetBoolean(5)
                     });
                 }
             }
             return list;
         }
     }
     catch
     {
         throw;
     }
 }
コード例 #6
0
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="SQLCommand"></param>
        /// <returns></returns>
        public List <PUsers_Function_Detailed> selectPUsers_Function_DetailedDal(string SQLCommand)
        {
            string sql = SQLhelp.GetSQLCommand(SQLCommand);
            List <PUsers_Function_Detailed> list = new List <PUsers_Function_Detailed>();

            try
            {
                using (SqlDataReader reader = SQLhelp.ExecuteReader(sql, CommandType.Text))
                {
                    if (reader.HasRows)
                    {
                        while (reader.Read())
                        {
                            list.Add(new PUsers_Function_Detailed()
                            {
                                UserName             = reader.GetString(0),
                                FunctionName         = reader.GetString(1),
                                FunctionJurisdiction = reader.GetBoolean(2),
                                FunctionGUID         = reader.GetString(3)
                            });
                        }
                    }
                    return(list);
                }
            }
            catch
            {
                throw;
            }
        }
        /// <summary>
        /// 插入
        /// </summary>
        /// <param name="data"></param>
        /// <param name="SQLCommand"></param>
        /// <returns></returns>
        public int insertTimeAttendance_AttendanceInformation_machineDal(TimeAttendance_AttendanceInformation_machine data, string SQLCommand)
        {
            string sql = SQLhelp.GetSQLCommand(SQLCommand);

            SqlParameter[] pms = new SqlParameter[]
            {
                new SqlParameter("@MachineID", SqlDbType.VarChar, 50)
                {
                    Value = data.MachineID
                },
                new SqlParameter("@ComInterface", SqlDbType.VarChar, 50)
                {
                    Value = data.ComInterface
                },
                new SqlParameter("@BaudRate", SqlDbType.VarChar, 50)
                {
                    Value = data.BaudRate
                },
                new SqlParameter("@IPAddress", SqlDbType.VarChar, 50)
                {
                    Value = data.IPAddress
                },
                new SqlParameter("@MachinePosition", SqlDbType.VarChar, 80)
                {
                    Value = data.MachinePosition
                },
                new SqlParameter("@MachineUse", SqlDbType.VarChar, 50)
                {
                    Value = data.MachineUse
                },
            };

            return(SQLhelp.ExecuteNonQuery(sql, CommandType.Text, pms));
        }
コード例 #8
0
        public int insertProductionLinePCDal(List <ProductionLinePC> list, string SQLCommand)
        {
            string sql = SQLhelp.GetSQLCommand(SQLCommand);

            SqlParameter[] pms = new SqlParameter[] {
                new SqlParameter("@pcname", SqlDbType.VarChar, 100)
                {
                    Value = list[0].Pcname
                },
                new SqlParameter("@producttype", SqlDbType.VarChar, 20)
                {
                    Value = list[0].ProductType
                },
                new SqlParameter("@linename", SqlDbType.VarChar, 80)
                {
                    Value = list[0].LineName
                },
                new SqlParameter("@companyname", SqlDbType.VarChar, 50)
                {
                    Value = list[0].CompanyName
                }
            };

            return(SQLhelp.ExecuteNonQuery(sql, CommandType.Text, pms));
        }
コード例 #9
0
        /// <summary>
        /// 修改权限
        /// </summary>
        /// <param name="list"></param>
        /// <param name="SQLCommand"></param>
        /// <returns></returns>
        public int updatePUsers_FunctionDal(List <PUsers_Function> list, string SQLCommand)
        {
            string sql = SQLhelp.GetSQLCommand(SQLCommand);

            SqlParameter[] pms = new SqlParameter[] {
                new SqlParameter("@UserName", SqlDbType.VarChar, 50)
                {
                    Value = list[0].UserName
                },
                new SqlParameter("@FunctionGUID", SqlDbType.VarChar, 100)
                {
                    Value = list[0].FunctionGUID
                },
                new SqlParameter("@FunctionName", SqlDbType.VarChar, 50)
                {
                    Value = list[0].FunctionName
                },
                new SqlParameter("@NewFunctionJurisdiction", SqlDbType.Bit)
                {
                    Value = list[0].FunctionJurisdiction
                }
            };

            return(SQLhelp.ExecuteNonQuery(sql, CommandType.Text, pms));
        }
コード例 #10
0
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="SQLCommand"></param>
        /// <returns></returns>
        public List <PRequiredTime_Detailed> selectPRequiredTime_DetailedDal(string SQLCommand)
        {
            string sql = SQLhelp.GetSQLCommand(SQLCommand);
            List <PRequiredTime_Detailed> list = new List <PRequiredTime_Detailed>();

            try
            {
                using (SqlDataReader reader = SQLhelp.ExecuteReader(sql, CommandType.Text))
                {
                    if (reader.HasRows)
                    {
                        while (reader.Read())
                        {
                            list.Add(new PRequiredTime_Detailed()
                            {
                                ProductType      = reader.GetString(0),
                                RequiredTimeGUID = reader.GetString(1),
                                RequiredTime     = reader.GetDouble(2)
                            });
                        }
                    }
                    return(list);
                }
            }
            catch
            {
                throw;
            }
        }
コード例 #11
0
        /// <summary>
        /// 查询产能配置抬头表
        /// </summary>
        /// <param name="SQLCommand"></param>
        /// <returns></returns>
        public List <ProductSet_New_title> selectProductSet_New_titleDal(string SQLCommand)
        {
            string sql = SQLhelp.GetSQLCommand(SQLCommand);

            List <ProductSet_New_title> list = new List <ProductSet_New_title>();

            try
            {
                using (SqlDataReader reader = SQLhelp.ExecuteReader(sql, CommandType.Text))
                {
                    if (reader.HasRows)
                    {
                        while (reader.Read())
                        {
                            list.Add(new ProductSet_New_title()
                            {
                                Id           = reader.GetInt32(0),
                                ProductClass = reader.GetString(1),
                                UpdateTime   = reader.GetDateTime(2)
                            });
                        }
                    }
                    return(list);
                }
            }
            catch
            {
                throw;
            }
        }
コード例 #12
0
        /// <summary>
        /// 查询失败产品表
        /// </summary>
        /// <param name="order">zhidan号</param>
        /// <param name="timeBegin">开始时间</param>
        /// <param name="timeEnd">结束时间</param>
        /// <param name="SQLCommand">SQL语句</param>
        /// <returns>int</returns>
        public int selectLTestLogMessageDal(string order, string SoftModel, DateTime timeBegin, DateTime timeEnd, string SQLCommand)
        {
            string sql = SQLhelp.GetSQLCommand(SQLCommand);

            if (order != "")
            {
                sql += " and llm.ZhiDan=  " + "'" + order + "'";
            }
            if (SoftModel != "")
            {
                sql += " and llm.SoftModel= " + "'" + SoftModel + "'";
            }
            SqlParameter[] pms = new SqlParameter[] {
                new SqlParameter("@TimeBegin", SqlDbType.DateTime)
                {
                    Value = timeBegin
                },
                new SqlParameter("@TimeEnd", SqlDbType.DateTime)
                {
                    Value = timeEnd
                }
            };

            try
            {
                return(Convert.ToInt32(SQLhelp.ExecuteScalar(sql, CommandType.Text, pms)));;
            }
            catch
            {
                throw;
            }
        }
コード例 #13
0
        public List <PFunctionMenu> selectPFunctionMenuFID00Dal(string SQLCommand)
        {
            string sql = SQLhelp.GetSQLCommand(SQLCommand);
            List <PFunctionMenu> list = new List <PFunctionMenu>();

            try
            {
                using (SqlDataReader reader = SQLhelp.ExecuteReader(sql, CommandType.Text))
                {
                    if (reader.HasRows)
                    {
                        while (reader.Read())
                        {
                            list.Add(new PFunctionMenu()
                            {
                                ID           = reader.GetString(0),
                                FunctionName = reader.GetString(1),
                                FID          = reader.GetString(2)
                            });
                        }
                    }
                    return(list);
                }
            }
            catch
            {
                throw;
            }
        }
コード例 #14
0
        /// <summary>
        /// 插入产能配置表
        /// </summary>
        /// <param name="list"></param>
        /// <param name="SQLCommand"></param>
        /// <returns></returns>
        public int insertProductSet_NewDal(List <ProductSet_New> list, string SQLCommand)
        {
            string sql = SQLhelp.GetSQLCommand(SQLCommand);

            SqlParameter[] pms = new SqlParameter[] {
                new SqlParameter("@productcalss", SqlDbType.VarChar, 100)
                {
                    Value = list[0].ProductClass
                },
                new SqlParameter("@stations", SqlDbType.VarChar, 50)
                {
                    Value = list[0].Stations
                },
                new SqlParameter("@efficiencyquantity", SqlDbType.VarChar, 100)
                {
                    Value = list[0].EfficiencyQuantity
                },
                new SqlParameter("@thenumberof", SqlDbType.VarChar, 100)
                {
                    Value = list[0].TheNumberOf
                }
            };

            return(SQLhelp.ExecuteNonQuery(sql, CommandType.Text, pms));
        }
コード例 #15
0
        /// <summary>
        /// 查询条件
        /// </summary>
        /// <param name="SQLComand"></param>
        /// <returns></returns>
        public List <selectConditionsQueryPStaffResumeModel2> selectConditionsQueryPStaffResumeDal2(string SQLComand)
        {
            string sql = SQLhelp.GetSQLCommand(SQLComand);

            List <selectConditionsQueryPStaffResumeModel2> list = new List <Gce_Model.selectConditionsQueryPStaffResumeModel2>();

            try
            {
                using (SqlDataReader reader = SQLhelp.ExecuteReader(sql, CommandType.Text))
                {
                    if (reader.HasRows)
                    {
                        while (reader.Read())
                        {
                            list.Add(new selectConditionsQueryPStaffResumeModel2()
                            {
                                Name        = reader.GetString(0),
                                WorkNumber  = reader.GetString(1),
                                CompanyName = reader.GetString(2)
                            });
                        }
                    }
                    return(list);
                }
            }
            catch
            {
                throw;
            }
        }
コード例 #16
0
        /// <summary>
        /// 增改
        /// </summary>
        /// <param name="data"></param>
        /// <param name="SQLCommand"></param>
        /// <returns></returns>
        public int insertTimeAttendance_AttendanceScheduleDal(TimeAttendance_AttendanceSchedule data, string SQLCommand)
        {
            string sql = SQLhelp.GetSQLCommand(SQLCommand);

            SqlParameter[] pms = new SqlParameter[]
            {
                new SqlParameter("@JobNumber", SqlDbType.VarChar, 50)
                {
                    Value = data.JobNumber
                },
                new SqlParameter("@Name", SqlDbType.VarChar, 80)
                {
                    Value = data.Name
                },
                new SqlParameter("@AttendanceTime", SqlDbType.DateTime)
                {
                    Value = data.AttendanceTime
                },
                new SqlParameter("@UpdateTime", SqlDbType.DateTime)
                {
                    Value = data.UpdateTime
                },
                new SqlParameter("@MachineID", SqlDbType.VarChar, 50)
                {
                    Value = data.MachineID
                },
                new SqlParameter("@MachinePosition", SqlDbType.VarChar, 50)
                {
                    Value = data.MachinePosition
                },
            };

            return(SQLhelp.ExecuteNonQuery(sql, CommandType.Text, pms));
        }
コード例 #17
0
        /// <summary>
        /// 插入
        /// </summary>
        /// <param name="list"></param>
        /// <param name="SQLCommand"></param>
        /// <returns></returns>
        public int insertPUsers_Function_DetailedDal(List <PUsers_Function_Detailed> list, string SQLCommand)
        {
            string sql = SQLhelp.GetSQLCommand(SQLCommand);

            SqlParameter[] pms = new SqlParameter[]
            {
                new SqlParameter("@UserName", SqlDbType.VarChar, 50)
                {
                    Value = list[0].UserName
                },
                new SqlParameter("@FunctionName", SqlDbType.VarChar, 50)
                {
                    Value = list[0].FunctionName
                },
                new SqlParameter("@FunctionJurisdiction", SqlDbType.Bit)
                {
                    Value = list[0].FunctionJurisdiction
                },
                new SqlParameter("@FunctionGUID", SqlDbType.VarChar, 100)
                {
                    Value = list[0].FunctionGUID
                },
            };
            try
            {
                return(SQLhelp.ExecuteNonQuery(sql, CommandType.Text, pms));
            }
            catch
            {
                throw;
            }
        }
コード例 #18
0
        public List <PWorkSchedule> selectPWorkScheduleDal(string SQLCommand)
        {
            string sql = SQLhelp.GetSQLCommand(SQLCommand);
            List <PWorkSchedule> list = new List <PWorkSchedule>();

            try
            {
                using (SqlDataReader reader = SQLhelp.ExecuteReader(sql, CommandType.Text))
                {
                    if (reader.HasRows)
                    {
                        while (reader.Read())
                        {
                            list.Add(new PWorkSchedule()
                            {
                                CompanyName            = reader.IsDBNull(0) ? "" : reader.GetString(0),
                                MorningOnWorkTime      = reader.IsDBNull(1) ? "" : reader.GetString(1),
                                MorningUnderWorkTime   = reader.IsDBNull(2) ? "" : reader.GetString(2),
                                AfternoonOnWorkTime    = reader.IsDBNull(3) ? "" : reader.GetString(3),
                                AfternoonUnderWorkTime = reader.IsDBNull(4) ? "" : reader.GetString(4),
                                NightOnWorkTime        = reader.IsDBNull(5) ? "" : reader.GetString(5),
                                Flag = reader.GetBoolean(7)
                            });
                        }
                    }
                    return(list);
                }
            }
            catch
            {
                throw;
            }
        }
コード例 #19
0
        /// <summary>
        /// 查询表中所有数据
        /// </summary>
        /// <param name="SQLCommand"></param>
        /// <returns></returns>
        public List <PTypesWork> selectPTypesWorkDal(string SQLCommand)
        {
            string            sql  = SQLhelp.GetSQLCommand(SQLCommand);
            List <PTypesWork> list = new List <PTypesWork>();

            try
            {
                using (SqlDataReader reader = SQLhelp.ExecuteReader(sql, CommandType.Text))
                {
                    if (reader.HasRows)
                    {
                        while (reader.Read())
                        {
                            list.Add(new PTypesWork()
                            {
                                TypesWork = reader.GetString(0)
                            });
                        }
                    }
                    return(list);
                }
            }
            catch
            {
                throw;
            }
        }
コード例 #20
0
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="data"></param>
        /// <param name="SQLCommand"></param>
        /// <returns></returns>
        public int updateTimeAttendance_DepartmentDal(TimeAttendance_Department data, string SQLCommand)
        {
            string sql = SQLhelp.GetSQLCommand(SQLCommand);

            SqlParameter[] pms = new SqlParameter[]
            {
                new SqlParameter("@DepartmentNo", SqlDbType.VarChar, 50)
                {
                    Value = data.DepartmentNo
                },
                new SqlParameter("@DepartmentName", SqlDbType.VarChar, 80)
                {
                    Value = data.DepartmentName
                },
                new SqlParameter("@NumberOfStaff", SqlDbType.Int)
                {
                    Value = data.NumberOfStaff
                },
                new SqlParameter("@InTheNumberOfStaff", SqlDbType.Int)
                {
                    Value = data.InTheNumberOfStaff
                },
                new SqlParameter("@ExceedNumberOfStaff", SqlDbType.Int)
                {
                    Value = data.ExceedNumberOfStaff
                },
                new SqlParameter("@note", SqlDbType.VarChar, 255)
                {
                    Value = data.note
                }
            };

            return(SQLhelp.ExecuteNonQuery(sql, CommandType.Text, pms));
        }
        public List <TimeAttendance_AttendanceInformation_machine> selectTimeAttendance_AttendanceInformation_machineDal(string SQLCommand)
        {
            string sql = SQLhelp.GetSQLCommand(SQLCommand);
            List <TimeAttendance_AttendanceInformation_machine> list = new List <TimeAttendance_AttendanceInformation_machine>();

            try
            {
                using (SqlDataReader reader = SQLhelp.ExecuteReader(sql, CommandType.Text))
                {
                    if (reader.HasRows)
                    {
                        while (reader.Read())
                        {
                            list.Add(new TimeAttendance_AttendanceInformation_machine()
                            {
                                MachineID       = reader.GetString(0),
                                ComInterface    = reader.IsDBNull(1)?"":reader.GetString(1),
                                BaudRate        = reader.IsDBNull(2) ? "" : reader.GetString(2),
                                IPAddress       = reader.IsDBNull(3) ? "" : reader.GetString(3),
                                MachinePosition = reader.IsDBNull(4) ? "" : reader.GetString(4),
                                MachineUse      = reader.IsDBNull(5) ? "" : reader.GetString(5),
                            });
                        }
                    }
                    return(list);
                }
            }
            catch
            {
                throw;
            }
        }
コード例 #22
0
        public List <TimeAttendance_Department> selectAllTimeAttendance_EmployeeParentDepartmentNoDal(string SQLCommand)
        {
            string sql = SQLhelp.GetSQLCommand(SQLCommand);
            List <TimeAttendance_Department> list = new List <TimeAttendance_Department>();

            try
            {
                using (SqlDataReader reader = SQLhelp.ExecuteReader(sql, CommandType.Text))
                {
                    if (reader.HasRows)
                    {
                        while (reader.Read())
                        {
                            list.Add(new TimeAttendance_Department()
                            {
                                DepartmentNo   = reader.GetString(0),
                                DepartmentName = reader.IsDBNull(1) ? "" : reader.GetString(1)
                            });
                        }
                    }
                    return(list);
                }
            }
            catch
            {
                throw;
            }
        }
コード例 #23
0
        public List <string> selectProductionLinePC_titleLineNameDal(string CompanyName, string SQLCommand)
        {
            string        sql  = SQLhelp.GetSQLCommand(SQLCommand);
            List <string> list = new List <string>();

            SqlParameter[] pms = new SqlParameter[] {
                new SqlParameter("@companyname", SqlDbType.VarChar, 50)
                {
                    Value = CompanyName
                }
            };
            try
            {
                using (SqlDataReader reader = SQLhelp.ExecuteReader(sql, CommandType.Text, pms))
                {
                    if (reader.HasRows)
                    {
                        while (reader.Read())
                        {
                            list.Add(reader.IsDBNull(0) ? "" : reader.GetString(0));
                        }
                    }
                    return(list);
                }
            }
            catch
            {
                throw;
            }
        }
コード例 #24
0
        /// <summary>
        /// 挑选更新
        /// </summary>
        /// <param name="PurchaseReceiptID"></param>
        /// <param name="ChooseNumber"></param>
        /// <param name="NotChooseNumber"></param>
        /// <param name="ChooseTime1"></param>
        /// <param name="SQLCommand"></param>
        /// <returns></returns>
        public int updatePurchaseReceiptChooseDal(string PurchaseReceiptID, int ChooseNumber, int NotChooseNumber, string ChooseName, DateTime ChooseTime1, string SQLCommand)
        {
            string sql = SQLhelp.GetSQLCommand(SQLCommand);

            SqlParameter[] pms = new SqlParameter[]
            {
                new SqlParameter("@PurchaseReceiptID", SqlDbType.VarChar, 100)
                {
                    Value = PurchaseReceiptID
                },
                new SqlParameter("@ChooseNumber", SqlDbType.Int)
                {
                    Value = ChooseNumber
                },
                new SqlParameter("@NotChooseNumber", SqlDbType.Int)
                {
                    Value = NotChooseNumber
                },
                new SqlParameter("@ChooseTime1", SqlDbType.DateTime)
                {
                    Value = ChooseTime1
                },
                new SqlParameter("@ChooseName", SqlDbType.VarChar, 50)
                {
                    Value = ChooseName
                }
            };

            return(SQLhelp.ExecuteNonQuery(sql, CommandType.Text, pms));
        }
コード例 #25
0
        /// <summary>
        /// 向ProductSet表修改一条数据
        /// </summary>
        /// <param name="list"></param>
        /// <param name="SQLCommand"></param>
        /// <returns></returns>
        public int UpdateProductSetBll(List <ProductSet> list, string SQLCommand)
        {
            string sql = SQLhelp.GetSQLCommand(SQLCommand);

            SqlParameter[] pms = new SqlParameter[] {
                new SqlParameter("@pc", SqlDbType.VarChar, 80)
                {
                    Value = list[0].ProductClass
                },
                new SqlParameter("@s1", SqlDbType.VarChar, 200)
                {
                    Value = list[0].station1
                },
                new SqlParameter("@n1", SqlDbType.VarChar, 200)
                {
                    Value = list[0].Numberof1
                },
                new SqlParameter("@id", SqlDbType.Int)
                {
                    Value = list[0].Id
                }
            };
            try
            {
                return(SQLhelp.ExecuteNonQuery(sql, CommandType.Text, pms));
            }
            catch
            {
                return(-1);
            }
        }
コード例 #26
0
        /// <summary>
        /// 查询异常配置表
        /// </summary>
        /// <param name="SQLCommand"></param>
        /// <returns></returns>
        public List <PEncodingSetting> selectPEncodingSettingDal(string SQLCommand)
        {
            string sql = SQLhelp.GetSQLCommand(SQLCommand);
            List <PEncodingSetting> list = new List <PEncodingSetting>();

            try
            {
                using (SqlDataReader reader = SQLhelp.ExecuteReader(sql, CommandType.Text))
                {
                    if (reader.HasRows)
                    {
                        while (reader.Read())
                        {
                            list.Add(new PEncodingSetting()
                            {
                                BarcodeEncoding    = reader.GetString(0),
                                ProblemDescription = reader.GetString(1),
                                ES_ExceptionTypes  = reader.GetString(2)
                            });
                        }
                    }
                    return(list);
                }
            }
            catch
            {
                throw;
            }
        }
コード例 #27
0
        public List <ProductSet> SelectProductTop1Dal(string SQLCommand)
        {
            string sql = SQLhelp.GetSQLCommand(SQLCommand);

            List <ProductSet> list = new List <ProductSet>();

            try
            {
                using (SqlDataReader reader = SQLhelp.ExecuteReader(sql, CommandType.Text))
                {
                    if (reader.HasRows)
                    {
                        while (reader.Read())
                        {
                            list.Add(new ProductSet()
                            {
                                ProductClass = reader.GetString(1),
                                station1     = reader.IsDBNull(2) ? "" : reader.GetString(2),
                                Numberof1    = reader.IsDBNull(3) ? "" : reader.GetString(3),
                                Id           = reader.GetInt32(0)
                            });
                        }
                    }
                    return(list);
                }
            }
            catch
            {
                throw;
            }
        }
コード例 #28
0
        /// <summary>
        /// 查询库存数量
        /// </summary>
        /// <param name="MaterialName"></param>
        /// <param name="SQLCommand"></param>
        /// <returns></returns>
        public ck_StockModel selectPWarehouseTable_DetailedProductQuantityDal(string MaterialName, string SQLCommand)
        {
            string sql = SQLhelp.GetSQLCommand(SQLCommand);

            ck_StockModel list = new ck_StockModel();

            SqlParameter[] pms = new SqlParameter[]
            {
                new SqlParameter("@MaterialName", SqlDbType.VarChar, 80)
                {
                    Value = MaterialName
                }
            };

            try
            {
                using (SqlDataReader reader = SQLhelp.ExecuteReader(sql, CommandType.Text, pms))
                {
                    if (reader.HasRows)
                    {
                        while (reader.Read())
                        {
                            list.MaterialName    = reader.IsDBNull(0)?"":reader.GetString(0);
                            list.ProductQuantity = reader.IsDBNull(1) ? 0 : reader.GetInt32(1);
                        }
                    }
                    return(list);
                }
            }
            catch
            {
                throw;
            }
        }
コード例 #29
0
        /// <summary>
        /// 查询所有数据
        /// </summary>
        /// <param name="SQLCommand"></param>
        /// <returns></returns>
        public List <PCapacityConfiguration> selectPCapacityConfigurationDal(string SQLCommand)
        {
            string sql = SQLhelp.GetSQLCommand(SQLCommand);
            List <PCapacityConfiguration> list = new List <PCapacityConfiguration>();

            try
            {
                using (SqlDataReader reader = SQLhelp.ExecuteReader(sql, CommandType.Text))
                {
                    if (reader.HasRows)
                    {
                        while (reader.Read())
                        {
                            list.Add(new PCapacityConfiguration
                            {
                                ZhiDan       = reader.GetString(0),
                                ProductClass = reader.GetString(1)
                            });
                        }
                    }
                    return(list);
                }
            }
            catch
            {
                throw;
            }
        }
コード例 #30
0
ファイル: UsersDal.cs プロジェクト: return001/MES_BM_GCE
        /// <summary>
        /// 检查用户名是否存在
        /// </summary>
        /// <param name="UserName">用户名</param>
        /// <param name="SQLCommand">SQK命令</param>
        /// <returns>int</returns>
        public int checkUserNemeDal(string UserName,string SQLCommand)
        {
            string sql = SQLhelp.GetSQLCommand(SQLCommand);

            SqlParameter[] pms = new SqlParameter[]{
                new SqlParameter("@username",SqlDbType.VarChar,50){Value=UserName}
            };

            return (int)SQLhelp.ExecuteScalar(sql, CommandType.Text, pms);
        }