public static int AddPowerAvgConfigure(string mOrganizationId, string mItemName, string mFormula, string mMaterial, string mDisplayIndex, string mEnabled)
        {
            string connectionString       = ConnectionStringFactory.NXJCConnectionString;
            ISqlServerDataFactory factory = new SqlServerDataFactory(connectionString);
            string mySql = @"INSERT INTO [dbo].[equipment_CustomerPowerContrast]
                                    ([EquipmentGroupId]
                                    ,[Name]
                                    ,[OrganizationID]
                                    ,[Formula]
                                    ,[MaterialId]
                                    ,[DisplayIndex]
                                    ,[Enabled])
                             VALUES
                                   (@mEquipmentGroupId
                                   ,@mItemName
                                   ,@mOrganizationId
                                   ,@mFormula
                                   ,@mMaterial
                                   ,@mDisplayIndex
                                   ,@mEnabled)";

            SqlParameter[] para = { new SqlParameter("@mEquipmentGroupId", System.Guid.NewGuid().ToString()),
                                    new SqlParameter("@mItemName",         mItemName),
                                    new SqlParameter("@mOrganizationId",   mOrganizationId),
                                    new SqlParameter("@mFormula",          mFormula),
                                    new SqlParameter("@mMaterial",         mMaterial),
                                    new SqlParameter("@mDisplayIndex",     mDisplayIndex),
                                    new SqlParameter("@mEnabled",          mEnabled) };
            int            dt = factory.ExecuteSQL(mySql, para);

            return(dt);
        }
        //编辑信息
        public static int EditMaterialContrast(string mId, string mMaterialID, string mVariableId, string mName, string mSpecs, string mVariableSpecs, string mStatisticalType, string mEditTime, string mRemark)
        {
            int dt;

            if (IsExistMaterialID(mMaterialID, mId, false))
            {
                dt = 2;
            }
            else
            {
                string connectionString       = ConnectionStringFactory.NXJCConnectionString;
                ISqlServerDataFactory factory = new SqlServerDataFactory(connectionString);
                // string mUserID = GetUserID(mUserName);
                string         mySql = @"UPDATE [dbo].[inventory_MaterialContrast] SET
                                  [MaterialID]=@mMaterialID
                                 ,[VariableId]=@mVariableId
                                 ,[Name]=@mName
                                 ,[Specs]=@mSpecs
                                 ,[VariableSpecs]=@mVariableSpecs
                                 ,[StatisticalType]=@mStatisticalType
                                 
                                 ,[EditTime]=@mEditTime
                                 ,[Remark]=@mRemark where [MaterialID]=@mId";
                SqlParameter[] paras = { new SqlParameter("@mMaterialID", mMaterialID), new SqlParameter("@mVariableId",    mVariableId),    new SqlParameter("@mName",            mName),
                                         new SqlParameter("@mSpecs",      mSpecs),      new SqlParameter("@mVariableSpecs", mVariableSpecs), new SqlParameter("@mStatisticalType", mStatisticalType),
                                         new SqlParameter("@mEditTime",   mEditTime),   new SqlParameter("@mRemark",        mRemark),
                                         new SqlParameter("@mId",         mId) };
                dt = factory.ExecuteSQL(mySql, paras);
            }
            return(dt);
        }
        public static int ToEditAssessmentDetail(string mOrganizationID, string mKeyId, string mAssessmentId, string mObjectId, string mWeightedValue, string mBestValue, string mWorstValue, string mEnabled, string mId)
        {
            string connectionString       = ConnectionStringFactory.NXJCConnectionString;
            ISqlServerDataFactory factory = new SqlServerDataFactory(connectionString);
            string mySql = @"UPDATE [dbo].[assessment_AssessmentDetail]
                               SET [AssessmentId] = @mAssessmentId
                                  ,[ObjectId] = @mObjectId
                                  ,[OrganizaitonID] =@mOrganizationID
                                  ,[KeyId] = @mKeyId
                                  ,[WeightedValue] = @mWeightedValue
                                  ,[BestValue] = @mBestValue
                                  ,[WorstValue] =@mWorstValue
                                  ,[Enabled] = @mEnabled
                             WHERE [Id] =@mId";

            SqlParameter[] para =
            {
                new SqlParameter("@mId",             mId),
                new SqlParameter("@mOrganizationID", mOrganizationID),
                new SqlParameter("@mKeyId",          mKeyId),
                new SqlParameter("@mAssessmentId",   mAssessmentId),
                new SqlParameter("@mObjectId",       mObjectId),
                new SqlParameter("@mWeightedValue",  mWeightedValue),
                new SqlParameter("@mBestValue",      mBestValue),
                new SqlParameter("@mWorstValue",     mWorstValue),
                new SqlParameter("@mEnabled",        mEnabled)
            };
            int result = factory.ExecuteSQL(mySql, para);

            return(result);
        }
        public static int EditPowerAvgConfigure(string mEquipmentGroupId, string mOrganizationId, string mItemName, string mFormula, string mMaterial, string mDisplayIndex, string mEnabled)
        {
            string connectionString       = ConnectionStringFactory.NXJCConnectionString;
            ISqlServerDataFactory factory = new SqlServerDataFactory(connectionString);

            string mySql = @"UPDATE [dbo].[equipment_CustomerPowerContrast]
                           SET [Name]= @mItemName
                            ,[OrganizationID]= @mOrganizationId
                            ,[Formula]= @mFormula
                            ,[MaterialId]= @mMaterial
                            ,[DisplayIndex]= @mDisplayIndex
                            ,[Enabled]= @mEnabled
                         WHERE [EquipmentGroupId] = @mEquipmentGroupId";

            SqlParameter[] para = { new SqlParameter("@mEquipmentGroupId", mEquipmentGroupId),
                                    new SqlParameter("@mItemName",         mItemName),
                                    new SqlParameter("@mOrganizationId",   mOrganizationId),
                                    new SqlParameter("@mFormula",          mFormula),
                                    new SqlParameter("@mMaterial",         mMaterial),
                                    new SqlParameter("@mDisplayIndex",     mDisplayIndex),
                                    new SqlParameter("@mEnabled",          mEnabled) };
            int            dt = factory.ExecuteSQL(mySql, para);

            return(dt);
        }
        public static DataTable GetShiftArrangement(string organizationId)
        {
            DataTable             table            = new DataTable();
            string                connectionString = ConnectionStringFactory.NXJCConnectionString;
            ISqlServerDataFactory dataFactory      = new SqlServerDataFactory(connectionString);
            string                mySql            = @"select A.OrganizationID,A.WorkingTeam,CONVERT(varchar(10),A.ShiftDate,20) as ShiftDate,CONVERT(varchar(10),A.UpdateDate,20) as UpdateDate
                                from system_ShiftArrangement A
                                where A.OrganizationID=@organizationId
                                order by WorkingTeam";
            SqlParameter          parameter        = new SqlParameter("organizationId", organizationId);

            table = dataFactory.Query(mySql, parameter);
            string       mSql   = @"SELECT [ID]
                              ,[OrganizationID]
                              ,[Name]
                              ,[ChargeManID]
                              ,[Remarks]
                          FROM [system_WorkingTeam]
                           where [OrganizationID]=@organizationId";
            SqlParameter para   = new SqlParameter("organizationId", organizationId);
            DataTable    result = dataFactory.Query(mSql, para);

            if (table.Rows.Count < result.Rows.Count && table.Rows.Count != 0)
            {
                DataRow row = table.NewRow();
                row["OrganizationID"] = organizationId;
                row["WorkingTeam"]    = "常白";
                row["ShiftDate"]      = "";
                row["UpdateDate"]     = "";
                table.Rows.Add(row);
            }
            if (table.Rows.Count == 0)
            {
                IList <string> list = new List <string>();
                if (result.Rows.Count == 4)
                {
                    list.Add("A班");
                    list.Add("B班");
                    list.Add("C班");
                    list.Add("D班");
                }
                if (result.Rows.Count == 5)
                {
                    list.Add("A班");
                    list.Add("B班");
                    list.Add("C班");
                    list.Add("D班");
                    list.Add("常白");
                }
                foreach (string t_item in list)
                {
                    string insertSQL = @"insert into [dbo].[system_ShiftArrangement] ([OrganizationID],[WorkingTeam],[UpdateDate])
                                        values ('{0}','{1}',GETDATE())";
                    dataFactory.ExecuteSQL(string.Format(insertSQL, organizationId, t_item));
                }
                SqlParameter parameterlast = new SqlParameter("organizationId", organizationId);
                table = dataFactory.Query(mySql, parameterlast);
            }
            return(table);
        }
Ejemplo n.º 6
0
        public static int EditWorkingSection(string mWorkingSectionID, string mProductionName, string mSectionType, string mWorkingSection, string mEnabed, string mEditor, string mRemark)
        {
            string connectionString       = ConnectionStringFactory.NXJCConnectionString;
            ISqlServerDataFactory factory = new SqlServerDataFactory(connectionString);

            string mySql = @"UPDATE [dbo].[system_WorkingSection]
                               SET [WorkingSectionName] = @mWorkingSectionName
                                  ,[Type] = @mType
                                  ,[OrganizationID] = @mOrganizationID                                 
                                  ,[Creator] = @mCreator
                                  ,[CreatedTime] = @mCreatedTime
                                  ,[Enabled] = @mEnabled
                                  ,[Remarks] = @mRemarks
                         WHERE [WorkingSectionID] =@mWorkingSectionID";

            SqlParameter[] para = { new SqlParameter("@mWorkingSectionID",   mWorkingSectionID),
                                    new SqlParameter("@mWorkingSectionName", mWorkingSection),
                                    new SqlParameter("@mType",               mSectionType),
                                    new SqlParameter("@mOrganizationID",     mProductionName),
                                    new SqlParameter("@mCreator",            mEditor),
                                    new SqlParameter("@mCreatedTime",        DateTime.Now.ToString()),
                                    new SqlParameter("@mEnabled",            mEnabed),
                                    new SqlParameter("@mRemarks",            mRemark) };
            int            dt = factory.ExecuteSQL(mySql, para);

            return(dt);
        }
Ejemplo n.º 7
0
        public static int AddSectionWorkingDefine(string mWorkingSectionID, string mShifts, string mStartTime, string mEndTime, string mRemark)
        {
            string connectionString       = ConnectionStringFactory.NXJCConnectionString;
            ISqlServerDataFactory factory = new SqlServerDataFactory(connectionString);
            string mySql = @"INSERT INTO [dbo].[system_WorkingSectionShiftDescription]
                                   ([ShiftDescriptionID]
                                   ,[WorkingSectionID]
                                   ,[Shifts]
                                   ,[StartTime]
                                   ,[EndTime]
                                   ,[Remark])
                             VALUES
                                   (@mShiftDescriptionID
                                   ,@mWorkingSectionID
                                   ,@mShifts
                                   ,@mStartTime
                                   ,@mEndTime
                                   ,@mRemark)";

            SqlParameter[] para = { new SqlParameter("@mShiftDescriptionID", System.Guid.NewGuid().ToString()),
                                    new SqlParameter("@mWorkingSectionID",   mWorkingSectionID),
                                    new SqlParameter("@mShifts",             mShifts),
                                    new SqlParameter("@mStartTime",          mStartTime),
                                    new SqlParameter("@mEndTime",            mEndTime),
                                    new SqlParameter("@mRemark",             mRemark) };
            int            dt = factory.ExecuteSQL(mySql, para);

            return(dt);
        }
        //根据用户名获得用户ID
        //public static string GetUserID(string mUserName)
        //{
        //    string connectionString = ConnectionStringFactory.NXJCConnectionString;
        //    ISqlServerDataFactory dataFactory = new SqlServerDataFactory(connectionString);
        //    string mySql = @"select A.USER_ID FROM [IndustryEnergy_SH].[dbo].[users] AS A WHERE A.USER_NAME=@mUserName";
        //    SqlParameter para = new SqlParameter("@mUserName", mUserName);
        //    DataTable table = dataFactory.Query(mySql, para);
        //    string UserID="";
        //    if (table.Rows.Count != 0)
        //    {
        //       UserID=table.Rows[0]["USER_ID"].ToString();
        //    }
        //    return UserID;
        //}

        //添加信息
        public static int AddMaterialContrast(string mMaterialID, string mVariableId, string mName, string mSpecs, string mVariableSpecs, string mStatisticalType, string mEditTime, string mRemark, string mUserId)
        {
            int dt;

            if (IsExistMaterialID(mMaterialID, "", true))
            {
                dt = 2;//若为2则存在重复的mMaterialID
            }
            else
            {
                string connectionString       = ConnectionStringFactory.NXJCConnectionString;
                ISqlServerDataFactory factory = new SqlServerDataFactory(connectionString);

                string         mySql = @"INSERT INTO [dbo].[inventory_MaterialContrast]
                                 ([MaterialID]
                                 ,[VariableId]
                                 ,[Name]
                                 ,[Specs]
                                 ,[VariableSpecs]
                                 ,[StatisticalType]
                                 ,[Editor]
                                 ,[EditTime]
                                 ,[Remark]) VALUES (@mMaterialID,@mVariableId,@mName,@mSpecs,@mVariableSpecs,@mStatisticalType,@mEditor,@mEditTime,@mRemark)";
                SqlParameter[] paras = { new SqlParameter("@mMaterialID", mMaterialID), new SqlParameter("@mVariableId",    mVariableId),    new SqlParameter("@mName",            mName),
                                         new SqlParameter("@mSpecs",      mSpecs),      new SqlParameter("@mVariableSpecs", mVariableSpecs), new SqlParameter("@mStatisticalType", mStatisticalType),
                                         new SqlParameter("@mEditor",     mUserId),     new SqlParameter("@mEditTime",      mEditTime),      new SqlParameter("@mRemark",          mRemark) };
                dt = factory.ExecuteSQL(mySql, paras);
            }
            return(dt);
        }
        /// <summary>
        /// 编辑操作
        /// </summary>
        /// <param name="mProductionID"></param>
        /// <param name="mWorkingSectionID"></param>
        /// <param name="mName"></param>
        /// <param name="mType"></param>
        /// <param name="mCreator"></param>
        /// <param name="mRemark"></param>
        /// <param name="mKeyId"></param>
        /// <returns></returns>
        public static int ToEditAssessmentVersion(string mProductionID, string mWorkingSectionID, string mName, string mType, string mCreator, string mRemark, string mKeyId)
        {
            string connectionString       = ConnectionStringFactory.NXJCConnectionString;
            ISqlServerDataFactory factory = new SqlServerDataFactory(connectionString);

            string mySql = @" UPDATE [dbo].[tz_Assessment]
                               SET [Name] = @mName
                                  ,[Type] = @mType
                                  ,[OrganizationID] = @mProductionID
                                  ,[WorkingSectionID] = @mWorkingSectionID
                                  ,[Remark] = @mRemark
                                  ,[Creator] = @mCreator
                                  ,[CreateTime] = @mTime
                             WHERE [KeyId] =@mKeyId";

            SqlParameter[] para =
            {
                new SqlParameter("@mKeyId",            mKeyId),
                new SqlParameter("@mProductionID",     mProductionID),
                new SqlParameter("@mWorkingSectionID", mWorkingSectionID),
                new SqlParameter("@mName",             mName),
                new SqlParameter("@mType",             mType),
                new SqlParameter("@mCreator",          mCreator),
                new SqlParameter("@mRemark",           mRemark),
                new SqlParameter("@mTime",             DateTime.Now.ToString())
            };
            int result = factory.ExecuteSQL(mySql, para);

            return(result);
        }
Ejemplo n.º 10
0
        //"{mStandardLevel:'InternationalStandard',mEnergyType:'Comprehensive',mObjName:'test',mOrganizationId:'zc_nxjc_byc_byf_cementmill01',mLevelType:'Process',
        //mVariableId:'cementGrind',mValueType:'ElectricityConsumption',mtype:'Energy',mUnit:'kW·h/t',mStandardValue:''}"
        public static void DeleteKPIndex(string standardItemId)
        {
            string connectionString           = ConnectionStringFactory.NXJCConnectionString;
            ISqlServerDataFactory dataFactory = new SqlServerDataFactory(connectionString);
            string       Deletesql            = @"DELETE FROM [analyse_KPI_Standard_Detail]
                                              WHERE [StandardItemId] = @standardItemId";
            SqlParameter para = new SqlParameter("@standardItemId", standardItemId);

            dataFactory.ExecuteSQL(Deletesql, para);
        }
Ejemplo n.º 11
0
 public static int DeletePVFInfo(string PVFId)
 {
     string connectionString = ConnectionStringFactory.NXJCConnectionString;
     ISqlServerDataFactory factory = new SqlServerDataFactory(connectionString);
     string mySql = @"delete from [dbo].[system_PVF_Detail]
                  WHERE [ID]=@PVFId";
     SqlParameter para = new SqlParameter("@PVFId", PVFId);
     int dt = factory.ExecuteSQL(mySql, para);
     return dt;
 }
Ejemplo n.º 12
0
        public static int deleteLowLoadOperationConfig(string m_Id)
        {
            string connectionString       = ConnectionStringFactory.NXJCConnectionString;
            ISqlServerDataFactory factory = new SqlServerDataFactory(connectionString);
            string       mySql            = @"delete from [dbo].[equipment_LowLoadOperationConfig]
                         WHERE [ID] =@mItemId";
            SqlParameter para             = new SqlParameter("@mItemId", m_Id);
            int          dt = factory.ExecuteSQL(mySql, para);

            return(dt);
        }
        public static int ToDeleteAssessmentDetail(string mId)
        {
            string connectionString       = ConnectionStringFactory.NXJCConnectionString;
            ISqlServerDataFactory factory = new SqlServerDataFactory(connectionString);
            string       mySql            = @"DELETE FROM [dbo].[assessment_AssessmentDetail] 
                                 WHERE [Id] =@mId";
            SqlParameter para             = new SqlParameter("@mId", mId);
            int          result           = factory.ExecuteSQL(mySql, para);

            return(result);
        }
        public static int DeletePowerAvgConfigure(string mEquipmentGroupId)
        {
            string connectionString       = ConnectionStringFactory.NXJCConnectionString;
            ISqlServerDataFactory factory = new SqlServerDataFactory(connectionString);

            string       mySql = @"delete from [dbo].[equipment_CustomerPowerContrast]
                         WHERE [EquipmentGroupId] =@mEquipmentGroupId";
            SqlParameter para  = new SqlParameter("@mEquipmentGroupId", mEquipmentGroupId);
            int          dt    = factory.ExecuteSQL(mySql, para);

            return(dt);
        }
        public static int ToDeleteAssessmentVersion(string mKeyId)
        {
            string connectionString       = ConnectionStringFactory.NXJCConnectionString;
            ISqlServerDataFactory factory = new SqlServerDataFactory(connectionString);
            string       mySql            = @"
                            delete from  [dbo].[tz_Assessment] where [KeyId]=@mKeyId
                            delete from  [dbo].[assessment_AssessmentDetail] where [KeyId]=@mKeyId";
            SqlParameter para             = new SqlParameter("@mKeyId", mKeyId);
            int          result           = factory.ExecuteSQL(mySql, para);

            return(result);
        }
Ejemplo n.º 16
0
        public static int DeleteWarehouseInfomation(string mId)
        {
            string connectionString       = ConnectionStringFactory.NXJCConnectionString;
            ISqlServerDataFactory factory = new SqlServerDataFactory(connectionString);

            string       mySql = @"delete from [dbo].[inventory_Warehouse]
                         WHERE [Id] =@mId";
            SqlParameter para  = new SqlParameter("@mId", mId);
            int          dt    = factory.ExecuteSQL(mySql, para);

            return(dt);
        }
        //删除信息
        public static int DeleteMaterialContrast(string mMaterialID)
        {
            string connectionString       = ConnectionStringFactory.NXJCConnectionString;
            ISqlServerDataFactory factory = new SqlServerDataFactory(connectionString);

            string       mySql = @"delete from [dbo].[inventory_MaterialContrast]
                         WHERE [MaterialID] =@mMaterialID";
            SqlParameter para  = new SqlParameter("@mMaterialID", mMaterialID);
            int          dt    = factory.ExecuteSQL(mySql, para);

            return(dt);
        }
Ejemplo n.º 18
0
        public static int deleteWorkingSection(string mWorkingSectionID)
        {
            string connectionString       = ConnectionStringFactory.NXJCConnectionString;
            ISqlServerDataFactory factory = new SqlServerDataFactory(connectionString);

            string       mySql = @"delete from [dbo].[system_WorkingSection]
                         WHERE [WorkingSectionID] =@mWorkingSectionID";
            SqlParameter para  = new SqlParameter("@mWorkingSectionID", mWorkingSectionID);
            int          dt    = factory.ExecuteSQL(mySql, para);

            return(dt);
        }
        public static int deleteWarehousing(string mItemId)
        {
            string connectionString       = ConnectionStringFactory.NXJCConnectionString;
            ISqlServerDataFactory factory = new SqlServerDataFactory(connectionString);

            string       mySql = @"delete from [inventory_WareHousingContrast]
                         WHERE ItemId =@mItemId";
            SqlParameter para  = new SqlParameter("@mItemId", mItemId);
            int          dt    = factory.ExecuteSQL(mySql, para);

            return(dt);
        }
        public static int InsertWarehousing(string mWarehousingtype, string mWarehousenameId, string mVariableid, string mSpecies, string mDatabasename, string mDatatablename, string mMultiple,
                                            string mOffset, string mUserId, string mRemark) //
        {
            string connectionString       = ConnectionStringFactory.NXJCConnectionString;
            ISqlServerDataFactory factory = new SqlServerDataFactory(connectionString);

            string mySql = @"INSERT INTO [inventory_WareHousingContrast]   
                            ([ItemId]
                            ,[WarehouseId]
                            ,[VariableId]
                            ,[Specs]
                            ,[DataBaseName]
                            ,[DataTableName]
                            ,[WarehousingType]
                            ,[Multiple]
                            ,[Offset]
                            ,[Editor]
                            ,[Remark]
                            ,[EditTime]
                                        )
                           
                        VALUES
                        (    @mItemId
                            , @mWarehousenameId
                            , @mVariableid
                            , @mSpecies
                            , @mDatabasename
                            , @mDatatablename
                            , @mWarehousingtype
                            , @mMultiple
                            , @mOffset
                            , @mUserId 
                            , @mRemark
                            , @mEditTime
                         )";

            SqlParameter[] para = { new SqlParameter("@mItemId",          System.Guid.NewGuid().ToString()), ////)  //
                                    new SqlParameter("@mWarehousenameId", mWarehousenameId),
                                    new SqlParameter("@mVariableid",      mVariableid),
                                    new SqlParameter("@mSpecies",         mSpecies),
                                    new SqlParameter("@mDatabasename",    mDatabasename),
                                    new SqlParameter("@mDatatablename",   mDatatablename),
                                    new SqlParameter("@mWarehousingtype", mWarehousingtype),
                                    new SqlParameter("@mMultiple",        mMultiple),
                                    new SqlParameter("@mOffset",          mOffset),
                                    new SqlParameter("@mUserId",          mUserId),
                                    new SqlParameter("@mEditTime",        DateTime.Now.ToString()),
                                    new SqlParameter("@mRemark",          mRemark) };
            int            dt = factory.ExecuteSQL(mySql, para);

            return(dt);
        }
Ejemplo n.º 21
0
        public static void AddKPIndexProductionList(string mStandardLevel, string mObjName, string mOrganizationId, string mLevelType, string mVariableId,
                                                    string mValueType, string mUnit, float mStandardValue, int mLevel, string mCreator)
        {
            string mKeyId                     = GetKeyId(mStandardLevel);
            string connectionString           = ConnectionStringFactory.NXJCConnectionString;
            ISqlServerDataFactory dataFactory = new SqlServerDataFactory(connectionString);
            string mySql = @"INSERT INTO [dbo].[analyse_KPI_Standard_Detail]
                                           ([KeyId]
                                           ,[Name]
                                           ,[OrganizationID]
                                           ,[LevelType]
                                           ,[VariableId]
                                           ,[ValueType]
                                           ,[StandardType]
                                           ,[Unit]
                                           ,[StandardValue]
                                           ,[StandardLevel]
                                           ,[Creator]
                                           ,[CreateTime]
                                           ,[Enabled])
                                     VALUES
                                           (@KeyId
                                           ,@Name
                                           ,@OrganizationID
                                           ,@LevelType
                                           ,@VariableId
                                           ,@ValueType
                                           ,'Production'
                                           ,@Unit
                                           ,@StandardValue
                                           ,@StandardLevel
                                           ,@Creator
                                           ,getdate()
                                           ,1)";

            SqlParameter[] Para = { new SqlParameter("@KeyId",          mKeyId),
                                    new SqlParameter("@Name",           mObjName),
                                    new SqlParameter("@OrganizationID", mOrganizationId),
                                    new SqlParameter("@LevelType",      mLevelType),
                                    new SqlParameter("@VariableId",     mVariableId),
                                    new SqlParameter("@ValueType",      mValueType),
                                    new SqlParameter("@Unit",           mUnit),
                                    new SqlParameter("@StandardValue",  mStandardValue),
                                    new SqlParameter("@StandardLevel",  mLevel),
                                    new SqlParameter("@Creator",        mCreator) };
            if (mOrganizationId == "")
            {
                Para[2] = new SqlParameter("@OrganizationID", DBNull.Value);
            }
            dataFactory.ExecuteSQL(mySql, Para);
        }
Ejemplo n.º 22
0
        /// <summary>
        /// 删除设备
        /// </summary>
        /// <param name="variableId"></param>
        /// <param name="organizationId"></param>
        /// <returns></returns>
        public static string RemoveEquipment(string variableId, string organizationId)
        {
            string connectionString           = ConnectionStringFactory.NXJCConnectionString;
            ISqlServerDataFactory dataFactory = new SqlServerDataFactory(connectionString);
            string removeSql = @"DELETE FROM system_EquipmentAccount WHERE VariableId=@VariableId AND OrganizationID=@OrganizationID";

            SqlParameter[] removeParameters = { new SqlParameter("VariableId", variableId), new SqlParameter("OrganizationID", organizationId) };
            int            n = dataFactory.ExecuteSQL(removeSql, removeParameters);
            string         removeFormulaSql = @"DELETE FROM formula_FormulaDetail  
                                        WHERE VariableId=@VariableId AND KeyID=(select KeyID from tz_Material where OrganizationID=@OrganizationID)";

            SqlParameter[] removeFormulaParameters = { new SqlParameter("VariableId", variableId), new SqlParameter("OrganizationID", organizationId) };
            int            m = dataFactory.ExecuteSQL(removeFormulaSql, removeFormulaParameters);

            if (0 == n)
            {
                return("删除设备失败");
            }
            else
            {
                return("删除成功");
            }
        }
Ejemplo n.º 23
0
        public static int EditLowLoadOperationConfig(string m_Id, string mOrganizationId, string m_VariableDesc, string m_RunTag, string MasterTableName, string MasterDataBaseName, string m_Record, string m_ValidValues, string m_DelayTime, string m_LoadTag, string m_DCSLoadTag, string s_MasterTableName, string s_MasterDataBaseName, string m_LoadTagType, string m_LLoadLimit, string m_UserId, string m_Remark)
        {
            string connectionString       = ConnectionStringFactory.NXJCConnectionString;
            ISqlServerDataFactory factory = new SqlServerDataFactory(connectionString);

            string mySql = @"UPDATE [dbo].[equipment_LowLoadOperationConfig]
                           SET   [ID]=@mItemId
                                ,[OrganizationID]=@mOrganizationId
                                ,[VariableDescription]=@m_VariableDesc
                                ,[RunTag]=@m_RunTag
                                ,[RunTagTableName]=@MasterTableName
                                ,[RunTagDataBaseName]=@MasterDataBaseName
                                ,[Record]=@m_Record
                                ,[ValidValues]=@m_ValidValues
                                ,[DelayTime]=@m_DelayTime
                                ,[LoadTag]=@m_LoadTag
                                ,[DCSLoadTag]=@m_DCSLoadTag
                                ,[DCSLoadTableName]=@s_MasterTableName
                                ,[DCSLoadDataBaseName]=@s_MasterDataBaseName
                                ,[LoadTagType]=@m_LoadTagType
                                ,[LLoadLimit]=@m_LLoadLimit
                                ,[Editor]=@m_UserId
                                ,[EditTime]=@m_EditTime
                                ,[Remark]=@m_Remark
                         WHERE [ID] = @mItemId";

            SqlParameter[] para = { new SqlParameter("@mItemId",              m_Id),
                                    new SqlParameter("@mOrganizationId",      mOrganizationId),
                                    new SqlParameter("@m_VariableDesc",       m_VariableDesc),
                                    new SqlParameter("@m_RunTag",             m_RunTag),
                                    new SqlParameter("@MasterTableName",      MasterTableName),
                                    new SqlParameter("@MasterDataBaseName",   MasterDataBaseName),
                                    new SqlParameter("@m_Record",             m_Record),
                                    new SqlParameter("@m_ValidValues",        m_ValidValues),
                                    new SqlParameter("@m_DelayTime",          m_DelayTime),
                                    new SqlParameter("@m_LoadTag",            m_LoadTag),
                                    new SqlParameter("@m_DCSLoadTag",         m_DCSLoadTag),
                                    new SqlParameter("@s_MasterTableName",    s_MasterTableName),
                                    new SqlParameter("@s_MasterDataBaseName", s_MasterDataBaseName),
                                    new SqlParameter("@m_LoadTagType",        m_LoadTagType),
                                    new SqlParameter("@m_LLoadLimit",         m_LLoadLimit),
                                    new SqlParameter("@m_UserId",             m_UserId),
                                    new SqlParameter("@m_EditTime",           System.DateTime.Now.ToString()),
                                    new SqlParameter("@m_Remark",             m_Remark) };
            int            dt = factory.ExecuteSQL(mySql, para);

            return(dt);
        }
Ejemplo n.º 24
0
        /// <summary>
        /// 保存设备
        /// </summary>
        /// <param name="VariableId"></param>
        /// <param name="OrganizationID"></param>
        /// <param name="EquipmentName"></param>
        /// <param name="MonitorType"></param>
        /// <param name="PowerSupply"></param>
        /// <param name="VoltageGrade"></param>
        /// <param name="RatedCT"></param>
        /// <param name="AmmeterCode"></param>
        /// <param name="ActualCT"></param>
        /// <param name="Power"></param>
        /// <param name="Unit"></param>
        /// <param name="PowerSupplyPosition"></param>
        /// <param name="Remarks"></param>
        /// <returns></returns>
        public static string SaveEquipment(string VariableId, string OrganizationID, string EquipmentName, int MonitorType, string PowerSupply, string VoltageGrade,
                                           string RatedCT, string AmmeterCode, string ActualCT, string Power, string Unit, string Current, string PowerSupplyPosition, string Remarks)
        {
            string connectionString           = ConnectionStringFactory.NXJCConnectionString;
            ISqlServerDataFactory dataFactory = new SqlServerDataFactory(connectionString);
            string myCheckSql = @"SELECT * FROM system_EquipmentAccount where VariableId=@VariableId AND OrganizationID=@OrganizationID";

            SqlParameter[] m_checkParameters = { new SqlParameter("@VariableId",     VariableId),
                                                 new SqlParameter("@OrganizationID", OrganizationID) };
            DataTable      table = dataFactory.Query(myCheckSql, m_checkParameters);

            if (table.Rows.Count > 0)
            {
                return("该设备已经存在");
            }
            string mySql           = @"INSERT INTO system_EquipmentAccount 
                                   (EquipmentItemId, VariableId, OrganizationID, EquipmentName, MonitorType, PowerSupply, VoltageGrade, 
                                   RatedCT, AmmeterCode, ActualCT, [Power], Unit, [Current],PowerSupplyPosition, Remarks)
                            values(@EquipmentItemId, @VariableId, @OrganizationID, @EquipmentName, @MonitorType, @PowerSupply, @VoltageGrade, 
                                   @RatedCT, @AmmeterCode, @ActualCT, @Power, @Unit,@Current,@PowerSupplyPosition, @Remarks)";
            Guid   EquipmentItemId = Guid.NewGuid();

            SqlParameter[] m_Parameters = { new SqlParameter("@EquipmentItemId",     EquipmentItemId),
                                            new SqlParameter("@VariableId",          VariableId),
                                            new SqlParameter("@OrganizationID",      OrganizationID),
                                            new SqlParameter("@EquipmentName",       EquipmentName),
                                            new SqlParameter("@MonitorType",         MonitorType),
                                            new SqlParameter("@PowerSupply",         PowerSupply),
                                            new SqlParameter("@VoltageGrade",        VoltageGrade),
                                            new SqlParameter("@RatedCT",             RatedCT),
                                            new SqlParameter("@AmmeterCode",         AmmeterCode),
                                            new SqlParameter("@ActualCT",            ActualCT),
                                            new SqlParameter("@Power",               Power),
                                            new SqlParameter("@Unit",                Unit),
                                            new SqlParameter("@Current",             Current),
                                            new SqlParameter("@PowerSupplyPosition", PowerSupplyPosition),
                                            new SqlParameter("@Remarks",             Remarks) };
            int            num = dataFactory.ExecuteSQL(mySql, m_Parameters);

            if (num == 0)
            {
                return("保存失败");
            }
            else
            {
                return("保存成功");
            }
        }
Ejemplo n.º 25
0
        public static int InsertWorkingSection(string mProductionName, string mSectionType, string mWorkingSection, string mEnabed, string mEditor, string mRemark)
        {
            string connectionString       = ConnectionStringFactory.NXJCConnectionString;
            ISqlServerDataFactory factory = new SqlServerDataFactory(connectionString);

            string mySql = @"INSERT INTO [dbo].[system_WorkingSection]
                            ([WorkingSectionItemID]
                            ,[WorkingSectionID]
                            ,[WorkingSectionName]
                            ,[Type]
                            ,[OrganizationID]
                            ,[DisplayIndex]
                            ,[ElectricityQuantityId]
                            ,[OutputId]
                            ,[CoalWeightId]
                            ,[Creator]
                            ,[CreatedTime]
                            ,[Enabled]
                            ,[Remarks])
                        VALUES
                            (@mWorkingSectionItemID
                            ,@mWorkingSectionID
                            ,@mWorkingSectionName
                            ,@mType
                            ,@mOrganizationID
                            ,null
                            ,null
                            ,null
                            ,null
                            ,@mCreator
                            ,@mCreatedTime
                            ,@mEnabled
                            ,@mRemarks)";

            SqlParameter[] para = { new SqlParameter("@mWorkingSectionItemID", System.Guid.NewGuid().ToString()),
                                    new SqlParameter("@mWorkingSectionID",     System.Guid.NewGuid().ToString()),
                                    new SqlParameter("@mWorkingSectionName",   mWorkingSection),
                                    new SqlParameter("@mType",                 mSectionType),
                                    new SqlParameter("@mOrganizationID",       mProductionName),
                                    new SqlParameter("@mCreator",              mEditor),
                                    new SqlParameter("@mCreatedTime",          DateTime.Now.ToString()),
                                    new SqlParameter("@mEnabled",              mEnabed),
                                    new SqlParameter("@mRemarks",              mRemark) };
            int            dt = factory.ExecuteSQL(mySql, para);

            return(dt);
        }
Ejemplo n.º 26
0
 public static int editPVFInfo(string PVFid, string mKeyId, string mStartTime, string mEndTime, string typeValue)
 {
     string connectionString = ConnectionStringFactory.NXJCConnectionString;
     ISqlServerDataFactory factory = new SqlServerDataFactory(connectionString);
     string mySql = @"update [dbo].[system_PVF_Detail]
                      set [KeyID]=@mKeyId
                         ,[StartTime]=@mStartTime
                         ,[EndTime]=@mEndTime
                         ,[Type]=@typeValue
                    WHERE [ID]=@PVFid";
     SqlParameter[] paras = { new SqlParameter("@mKeyId", mKeyId),
                              new SqlParameter("@mStartTime", mStartTime),
                              new SqlParameter("@mEndTime", mEndTime),
                              new SqlParameter("@typeValue", typeValue),
                              new SqlParameter("@PVFid", PVFid)};
     int dt = factory.ExecuteSQL(mySql, paras);
     return dt;
 }
Ejemplo n.º 27
0
        public static int Save(string mworkingId, string organizationId, string mvDate, string mShift, string mStaffID)
        {
            string connectionString           = ConnectionStringFactory.NXJCConnectionString;
            ISqlServerDataFactory dataFactory = new SqlServerDataFactory(connectionString);
            string mySql = @"insert into [dbo].[shift_staffSignInRecord] (vDate,StaffID,OrganizationID,WorkingSectionID,Shifts) values
                                          (@mvDate,@mStaffID,@organizationId,@mworkingId,@mShift)";

            SqlParameter[] parameters =
            {
                new SqlParameter("@mworkingId",     mworkingId),
                new SqlParameter("@organizationId", organizationId),
                new SqlParameter("@mvDate",         mvDate),
                new SqlParameter("@mStaffID",       mStaffID),
                new SqlParameter("@mShift",         mShift)
            };
            int result = dataFactory.ExecuteSQL(mySql, parameters);

            return(result);
        }
Ejemplo n.º 28
0
        public static int EditWarehouseInfomation(string mId, string mWareHouseName, string mMaterialId, string mType, string mLevelCode, string mCubage, string mLength, string mWidth, string mHeight, string mHighLimit, string mLowLimit, string mUserId, string mAlarmEnable, string mRemark, string mOrganizationID)
        {
            string connectionString       = ConnectionStringFactory.NXJCConnectionString;
            ISqlServerDataFactory factory = new SqlServerDataFactory(connectionString);
            string mySql = @"UPDATE [dbo].[inventory_Warehouse]
                                SET  [Name]=@mWareHouseName
                                    ,[MaterialId]=@mMaterialId
                                    ,[Type]=@mType
                                    ,[LevelCode]=@mLevelCode
                                    ,[Cubage]=@mCubage
                                    ,[Length]=@mLength
                                    ,[Width]=@mWidth
                                    ,[Height]=@mHeight                                   
                                    ,[HighLimit]=@mHighLimit
                                    ,[LowLimit]=@mLowLimit
                                    ,[AlarmEnabled]=@mAlarmEnable
                                    ,[Remark]=@mRemark
                                    ,[CheckInventory]=1
                                    ,[Editor]=@mUserId
                                    ,[EditTime]=getdate()
                                    ,[Enabled]=1
                              WHERE  [Id]=@mId";

            SqlParameter[] para = { new SqlParameter("@mId",            mId),
                                    new SqlParameter("@mWareHouseName", mWareHouseName),
                                    new SqlParameter("@mMaterialId",    mMaterialId),
                                    new SqlParameter("@mType",          mType),
                                    new SqlParameter("@mLevelCode",     mLevelCode),
                                    new SqlParameter("@mCubage",        mCubage),
                                    new SqlParameter("@mLength",        mLength),
                                    new SqlParameter("@mWidth",         mWidth),
                                    new SqlParameter("@mHeight",        mHeight),
                                    new SqlParameter("@mHighLimit",     mHighLimit),
                                    new SqlParameter("@mLowLimit",      mLowLimit),
                                    new SqlParameter("@mAlarmEnable",   mAlarmEnable),
                                    new SqlParameter("@mUserId",        mUserId),
                                    new SqlParameter("@mRemark",        mRemark) };
            int            dt = factory.ExecuteSQL(mySql, para);

            return(dt);
        }
        public static int ToAddAssessmentDetail(string mOrganizationID, string mKeyId, string mAssessmentId, string mObjectId, string mWeightedValue, string mBestValue, string mWorstValue, string mEnabled)
        {
            string connectionString       = ConnectionStringFactory.NXJCConnectionString;
            ISqlServerDataFactory factory = new SqlServerDataFactory(connectionString);
            string mySql = @"INSERT INTO [dbo].[assessment_AssessmentDetail]
                                   ([Id]
                                   ,[AssessmentId]
                                   ,[ObjectId]
                                   ,[OrganizaitonID]
                                   ,[KeyId]
                                   ,[WeightedValue]
                                   ,[BestValue]
                                   ,[WorstValue]
                                   ,[Enabled])
                             VALUES
                                   (@mId
                                   ,@mAssessmentId
                                   ,@mObjectId
                                   ,@mOrganizationID
                                   ,@mKeyId
                                   ,@mWeightedValue
                                   ,@mBestValue
                                   ,@mWorstValue
                                   ,@mEnabled)";

            SqlParameter[] para =
            {
                new SqlParameter("@mId",             System.Guid.NewGuid().ToString()),
                new SqlParameter("@mOrganizationID", mOrganizationID),
                new SqlParameter("@mKeyId",          mKeyId),
                new SqlParameter("@mAssessmentId",   mAssessmentId),
                new SqlParameter("@mObjectId",       mObjectId),
                new SqlParameter("@mWeightedValue",  mWeightedValue),
                new SqlParameter("@mBestValue",      mBestValue),
                new SqlParameter("@mWorstValue",     mWorstValue),
                new SqlParameter("@mEnabled",        mEnabled)
            };
            int result = factory.ExecuteSQL(mySql, para);

            return(result);
        }
Ejemplo n.º 30
0
        public static int SaveWarehouseSection(string saveId, string saveValue, string saveTimeStamp, string myName)
        {
            string connectionString       = ConnectionStringFactory.NXJCConnectionString;
            ISqlServerDataFactory factory = new SqlServerDataFactory(connectionString);

            string mySql = @"update [inventory_CheckWarehouse]
                         set Value=@saveValue,TimeStamp=@saveTimeStam,Editor=@myName,EditTime=@time
                         WHERE [ItemId]=@saveId";

            SqlParameter[] paras =
            {
                new SqlParameter("@saveId",       saveId),
                new SqlParameter("@saveValue",    saveValue),
                new SqlParameter("@saveTimeStam", DateTime.Parse(saveTimeStamp).ToString("yyyy-MM-dd HH:mm:ss")),
                new SqlParameter("@myName",       myName),
                new SqlParameter("@time",         DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"))
            };
            int dt = factory.ExecuteSQL(mySql, paras);

            return(dt);
        }