Ejemplo n.º 1
0
        public DataSet GetUserPermissionDetail(string strSQLServer, string strDataBase, int FKCustomerID, int userID)
        {
            DataSet ds = new DataSet();

            DataAccessNet.SQLDataSet objCom        = new DataAccessNet.SQLDataSet();
            DataAccessNet.Command    objSQLCommand = default(DataAccessNet.Command);
            string strSQL = null;

            strSQL = "up_GetUserPermissionDetail @FKCustomerID, @userID";

            objSQLCommand = new DataAccessNet.Command(strSQL);
            objSQLCommand.AddParameter("@FKCustomerID", DataAccessNet.Command.ParameterType.Int, FKCustomerID);
            objSQLCommand.AddParameter("@userID", DataAccessNet.Command.ParameterType.Int, userID);


            try
            {
                ds = objCom.SelectResults(strSQLServer, strDataBase, objSQLCommand);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                ds = null;
            }
            return(ds);
        }
Ejemplo n.º 2
0
        public DataSet UpdateBoardLoopsCounter(string strSQLServer, string strDataBase, int PKBoardLoopCounter,
                                               int LoopsNumber, string Userupdated)
        {
            DataSet ds = new DataSet();

            DataAccessNet.SQLDataSet objCom        = new DataAccessNet.SQLDataSet();
            DataAccessNet.Command    objSQLCommand = default(DataAccessNet.Command);
            string strSQL = null;

            strSQL        = "EXEC up_UpdSerialLoopsCounter @PKBoardLoopCounter, @LoopsNumber, @Userupdated";
            objSQLCommand = new DataAccessNet.Command(strSQL);
            objSQLCommand.AddParameter("@PKBoardLoopCounter", DataAccessNet.Command.ParameterType.Int, PKBoardLoopCounter);
            objSQLCommand.AddParameter("@LoopsNumber", DataAccessNet.Command.ParameterType.Int, LoopsNumber);
            objSQLCommand.AddParameter("@Userupdated", DataAccessNet.Command.ParameterType.VarChar, Userupdated);

            try
            {
                ds = objCom.SelectResults(strSQLServer, strDataBase, objSQLCommand);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                ds = null;
            }
            return(ds);
        }
Ejemplo n.º 3
0
        public DataSet GetBoardLoopsNumber(string strSQLServer, string strDataBase, String SerialNumber, string Assembly)
        {
            DataSet ds = new DataSet();

            DataAccessNet.SQLDataSet objCom        = new DataAccessNet.SQLDataSet();
            DataAccessNet.Command    objSQLCommand = default(DataAccessNet.Command);
            string strSQL = null;

            strSQL        = "EXEC up_GetSerialLoopsCounterOtro @SerialNumber, @Assembly";
            objSQLCommand = new DataAccessNet.Command(strSQL);
            objSQLCommand.AddParameter("@SerialNumber", DataAccessNet.Command.ParameterType.VarChar, SerialNumber);
            objSQLCommand.AddParameter("@Assembly", DataAccessNet.Command.ParameterType.VarChar, Assembly);


            try
            {
                ds = objCom.SelectResults(strSQLServer, strDataBase, objSQLCommand);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                ds = null;
            }
            return(ds);
        }
Ejemplo n.º 4
0
        public DataSet ApproveAccess(string strSQLServer, string strDataBase, int PKUser, int PKApplication, int Approved, int Updater)
        {
            DataSet ds = new DataSet();

            DataAccessNet.SQLDataSet objCom        = new DataAccessNet.SQLDataSet();
            DataAccessNet.Command    objSQLCommand = default(DataAccessNet.Command);
            string strSQL = null;

            strSQL        = "EXEC up_ApproveAccess @PKUser, @PKApplication, @Approved, @Updater";
            objSQLCommand = new DataAccessNet.Command(strSQL);
            objSQLCommand.AddParameter("@PKUser", DataAccessNet.Command.ParameterType.Int, PKUser);
            objSQLCommand.AddParameter("@PKApplication", DataAccessNet.Command.ParameterType.Int, PKApplication);
            objSQLCommand.AddParameter("@Approved", DataAccessNet.Command.ParameterType.Int, Approved);
            objSQLCommand.AddParameter("@Updater", DataAccessNet.Command.ParameterType.Int, Updater);
            try
            {
                ds = objCom.SelectResults(strSQLServer, strDataBase, objSQLCommand);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                ds = null;
            }
            return(ds);
        }
Ejemplo n.º 5
0
        public DataSet chgUserPermissionDetail(string strSQLServer, string strDataBase, int FKCustomerID, int FKUserID, int FKroleID, bool Available, int FKLastUpdatedUserID)
        {
            DataSet ds = new DataSet();

            DataAccessNet.SQLDataSet objCom        = new DataAccessNet.SQLDataSet();
            DataAccessNet.Command    objSQLCommand = default(DataAccessNet.Command);
            string strSQL = null;

            strSQL = "up_chgUserPermissionDetail @FKCustomerID, @FKUserID,@FKroleID,@Available,@FKLastUpdatedUserID,@UserReadOnly";

            objSQLCommand = new DataAccessNet.Command(strSQL);
            objSQLCommand.AddParameter("@FKCustomerID", DataAccessNet.Command.ParameterType.Int, FKCustomerID);
            objSQLCommand.AddParameter("@FKUserID", DataAccessNet.Command.ParameterType.Int, FKUserID);
            objSQLCommand.AddParameter("@FKroleID", DataAccessNet.Command.ParameterType.Int, FKroleID);
            objSQLCommand.AddParameter("@Available", DataAccessNet.Command.ParameterType.Bit, Available);
            objSQLCommand.AddParameter("@FKLastUpdatedUserID", DataAccessNet.Command.ParameterType.Int, @FKLastUpdatedUserID);


            try
            {
                ds = objCom.SelectResults(strSQLServer, strDataBase, objSQLCommand);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                ds = null;
            }
            return(ds);
        }
Ejemplo n.º 6
0
        public DataSet UserHasAccess(string strSQLServer, string strDataBase, string pageName, int fkUser)
        {
            DataSet ds = new DataSet();

            DataAccessNet.SQLDataSet objCom        = new DataAccessNet.SQLDataSet();
            DataAccessNet.Command    objSQLCommand = default(DataAccessNet.Command);
            string strSQL = null;

            strSQL = "up_GetUserAccessTo @FKUser,@URL";

            objSQLCommand = new DataAccessNet.Command(strSQL);
            objSQLCommand.AddParameter("@FKUser", DataAccessNet.Command.ParameterType.VarChar, fkUser);
            objSQLCommand.AddParameter("@URL", DataAccessNet.Command.ParameterType.VarChar, pageName);

            try
            {
                ds = objCom.SelectResults(strSQLServer, strDataBase, objSQLCommand);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                ds = null;
            }
            return(ds);
        }
Ejemplo n.º 7
0
        public DataSet checkIfAssyLocallyExistsUpd(string strSQLServer, string strDataBase, string Assy, int FKCustomer, string PalledId)
        {
            DataSet ds = new DataSet();

            DataAccessNet.SQLDataSet objCom        = new DataAccessNet.SQLDataSet();
            DataAccessNet.Command    objSQLCommand = default(DataAccessNet.Command);
            string strSQL = null;

            strSQL = "EXEC up_GetLocallyAssemblyByCustomerTEMPORAL @FKCustomer, @Assy, @PalletId";

            objSQLCommand = new DataAccessNet.Command(strSQL);
            objSQLCommand.AddParameter("@Assy", DataAccessNet.Command.ParameterType.VarChar, Assy);
            objSQLCommand.AddParameter("@FKCustomer", DataAccessNet.Command.ParameterType.Int, FKCustomer);
            objSQLCommand.AddParameter("@PalletId", DataAccessNet.Command.ParameterType.VarChar, PalledId);

            try
            {
                ds = objCom.SelectResults(strSQLServer, strDataBase, objSQLCommand);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                ds = null;
            }
            return(ds);
        }
Ejemplo n.º 8
0
        public DataSet InsertPalletLink(string strSQLServer, string strDataBase, String SerialNumber, string PalletId, String Operation, string User, int Available)
        {
            DataSet ds = new DataSet();

            DataAccessNet.SQLDataSet objCom        = new DataAccessNet.SQLDataSet();
            DataAccessNet.Command    objSQLCommand = default(DataAccessNet.Command);
            string strSQL = null;

            strSQL        = "EXEC up_InsertPalletLink @SerialNumber, @PalletId, @Operation, @User, @Available";
            objSQLCommand = new DataAccessNet.Command(strSQL);
            objSQLCommand.AddParameter("@SerialNumber", DataAccessNet.Command.ParameterType.NChar, SerialNumber);
            objSQLCommand.AddParameter("@PalletId", DataAccessNet.Command.ParameterType.NChar, PalletId);
            objSQLCommand.AddParameter("@Operation", DataAccessNet.Command.ParameterType.NChar, Operation);
            objSQLCommand.AddParameter("@User", DataAccessNet.Command.ParameterType.NChar, User);
            objSQLCommand.AddParameter("@Available", DataAccessNet.Command.ParameterType.Int, Available);

            try
            {
                ds = objCom.SelectResults(strSQLServer, strDataBase, objSQLCommand);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                ds = null;
            }
            return(ds);
        }
Ejemplo n.º 9
0
        public DataSet GetPanelSize(string strSQLServer, string strDataBase, string Customer, string Serial)
        {
            DataSet ds = new DataSet();

            DataAccessNet.SQLDataSet objCom        = new DataAccessNet.SQLDataSet();
            DataAccessNet.Command    objSQLCommand = default(DataAccessNet.Command);
            string strSQL = null;

            strSQL = "SELECT P.[Panel_ID]" +
                     ",P.[Panel]" +
                     ",MAX([Mapping]) as Elements" +
                     ",Customer" +
                     " FROM CHISQLV10A.[JEMS].[dbo].[WP_Panels_V] P" +
                     " INNER JOIN CHISQLV10A.[JEMS].[dbo].WP_Wip W WITH (NOLOCK) ON P.Wip_ID = W.Wip_ID" +
                     " INNER JOIN CHISQLV10A.[JEMS].[dbo].CR_Customer_V C WITH (NOLOCK) ON C.Customer_ID = W.Customer_ID" +
                     " WHERE Customer like'%'+@Customer+'%' AND P.Panel = (SELECT Panel FROM CHISQLV10A.[JEMS].[dbo].WP_Panels_V WHERE SerialNumber = @Serial)" +
                     " GROUP BY P.Panel_ID, P.Panel, Customer";

            objSQLCommand = new DataAccessNet.Command(strSQL);
            objSQLCommand.AddParameter("@Customer", DataAccessNet.Command.ParameterType.NChar, Customer);
            objSQLCommand.AddParameter("@Serial", DataAccessNet.Command.ParameterType.NChar, Serial);
            try
            {
                ds = objCom.SelectResults(strSQLServer, strDataBase, objSQLCommand);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                ds = null;
            }
            return(ds);
        }
Ejemplo n.º 10
0
        public DataSet UpdateProcessStatusOnMES(string strSQLServer, string strDataBase, int WipID, int RouteStepID, int EquipmentID, string User)
        {
            DataSet ds = new DataSet();

            DataAccessNet.SQLDataSet objCom        = new DataAccessNet.SQLDataSet();
            DataAccessNet.Command    objSQLCommand = default(DataAccessNet.Command);
            string strSQL = null;

            strSQL        = "EXEC up_UpdateProcessStatusOnMES @WipID, @RouteStepID, @EquipmentID, @User";
            objSQLCommand = new DataAccessNet.Command(strSQL);
            objSQLCommand.AddParameter("@WipID", DataAccessNet.Command.ParameterType.Int, WipID);
            objSQLCommand.AddParameter("@User", DataAccessNet.Command.ParameterType.NChar, User);
            objSQLCommand.AddParameter("@RouteStepID", DataAccessNet.Command.ParameterType.Int, RouteStepID);
            objSQLCommand.AddParameter("@EquipmentID", DataAccessNet.Command.ParameterType.Int, EquipmentID);

            try
            {
                ds = objCom.SelectResults(strSQLServer, strDataBase, objSQLCommand);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                ds = null;
            }
            return(ds);
        }
Ejemplo n.º 11
0
        public DataSet InsertAssemblyUpd(string strSQLServer, string strDataBase, int Updater, string Assy, int Rows,
                                         int Columns, int FKCustomer, string PalletID, Boolean Panel, Boolean LoopValidation,
                                         int LoopsAllowed, Boolean CheckPointValidation)
        {
            DataSet ds = new DataSet();

            DataAccessNet.SQLDataSet objCom        = new DataAccessNet.SQLDataSet();
            DataAccessNet.Command    objSQLCommand = default(DataAccessNet.Command);
            string strSQL = null;

            strSQL        = "EXEC up_AddAssemblyUpdDos @Updater, @Assy, @Rows, @Columns, @FKCustomer, @PalletID, @Panel,@LoopValidation,@LoopsAllowed,@CheckPointValidation";
            objSQLCommand = new DataAccessNet.Command(strSQL);
            objSQLCommand.AddParameter("@Updater", DataAccessNet.Command.ParameterType.Int, Updater);
            objSQLCommand.AddParameter("@Assy", DataAccessNet.Command.ParameterType.NChar, Assy);
            objSQLCommand.AddParameter("@Rows", DataAccessNet.Command.ParameterType.Int, Rows);
            objSQLCommand.AddParameter("@Columns", DataAccessNet.Command.ParameterType.Int, Columns);
            objSQLCommand.AddParameter("@FKCustomer", DataAccessNet.Command.ParameterType.Int, FKCustomer);
            objSQLCommand.AddParameter("@PalletID", DataAccessNet.Command.ParameterType.NChar, PalletID);
            objSQLCommand.AddParameter("@Panel", DataAccessNet.Command.ParameterType.Bit, Panel);
            objSQLCommand.AddParameter("@LoopValidation", DataAccessNet.Command.ParameterType.Bit, LoopValidation);
            objSQLCommand.AddParameter("@LoopsAllowed", DataAccessNet.Command.ParameterType.Int, LoopsAllowed);
            objSQLCommand.AddParameter("@CheckPointValidation", DataAccessNet.Command.ParameterType.Bit, CheckPointValidation);

            try
            {
                ds = objCom.SelectResults(strSQLServer, strDataBase, objSQLCommand);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                ds = null;
            }
            return(ds);
        }
Ejemplo n.º 12
0
        public DataSet GetAdminEmail(string strSQLServer, string strDataBase, int PKApplication, int PKCustomer)
        {
            DataSet ds = new DataSet();

            DataAccessNet.SQLDataSet objCom        = new DataAccessNet.SQLDataSet();
            DataAccessNet.Command    objSQLCommand = default(DataAccessNet.Command);
            string strSQL = null;

            strSQL = "SELECT [PKApplication]" +
                     ",[Application]" +
                     ",[Admin]" +
                     ",[FirstName] + ' ' + [LastName] as AdminUser" +
                     ",[Email]" +
                     ",[Description]" +
                     ",[MainPage]" +
                     ",[FKUserUpdater]" +
                     " FROM [ValeoApps].[dbo].[CT_Applications] A" +
                     " INNER JOIN SC_AdminCustomerApplication ACA ON A.PKApplication = ACA.FKApplication" +
                     " INNER JOIN SC_Users U ON ACA.Admin = U.PKUser" +
                     " WHERE ACA.FKCustomer = @PKCustomer AND PKApplication = @PKApplication";
            objSQLCommand = new DataAccessNet.Command(strSQL);
            objSQLCommand.AddParameter("@PKApplication", DataAccessNet.Command.ParameterType.Int, PKApplication);
            objSQLCommand.AddParameter("@PKCustomer", DataAccessNet.Command.ParameterType.Int, PKCustomer);
            try
            {
                ds = objCom.SelectResults(strSQLServer, strDataBase, objSQLCommand);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                ds = null;
            }
            return(ds);
        }
Ejemplo n.º 13
0
        public void InsertFAQ(string strSQLServer, string strSQLDataBase,
                              string FAQ, int FKUserUpdater)
        {
            DataSet ds = new DataSet();

            DataAccessNet.SQLDataSet objCom        = new DataAccessNet.SQLDataSet();
            DataAccessNet.Command    objSQLCommand = default(DataAccessNet.Command);
            string strSQL = null;

            strSQL = "INSERT INTO [dbo].SY_PalletLinkFAQ  " +
                     "( " +
                     "FAQ " +
                     ",FKUserUpdater " +
                     ") " +
                     "VALUES " +
                     "( " +
                     "@FAQ " +
                     ",@FKUserUpdater " +
                     " )";

            objSQLCommand = new DataAccessNet.Command(strSQL);
            objSQLCommand.AddParameter("@FAQ", DataAccessNet.Command.ParameterType.NChar, FAQ);
            objSQLCommand.AddParameter("@FKUserUpdater", DataAccessNet.Command.ParameterType.Int, FKUserUpdater);

            try
            {
                objCom.SelectResults(strSQLServer, strSQLDataBase, objSQLCommand);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
Ejemplo n.º 14
0
        public DataSet GetUserID(string strSQLServer, string strDataBase, string User, int PKCustomer)
        {
            DataSet ds = new DataSet();

            DataAccessNet.SQLDataSet objCom        = new DataAccessNet.SQLDataSet();
            DataAccessNet.Command    objSQLCommand = default(DataAccessNet.Command);
            string strSQL = null;

            strSQL = "up_GetUserID @WindowsID, @PKCustomer";

            objSQLCommand = new DataAccessNet.Command(strSQL);
            objSQLCommand.AddParameter("@WindowsID", DataAccessNet.Command.ParameterType.VarChar, User);
            objSQLCommand.AddParameter("@PKCustomer", DataAccessNet.Command.ParameterType.Int, PKCustomer);

            try
            {
                ds = objCom.SelectResults(strSQLServer, strDataBase, objSQLCommand);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                ds = null;
            }
            return(ds);
        }
Ejemplo n.º 15
0
        public DataSet UpdateUser(string strSQLServer, string strDataBase, int EmployeeNumber, string User, string Name, string LastName, string email)
        {
            DataSet ds = new DataSet();

            DataAccessNet.SQLDataSet objCom        = new DataAccessNet.SQLDataSet();
            DataAccessNet.Command    objSQLCommand = default(DataAccessNet.Command);
            string strSQL = null;

            strSQL = "UPDATE [dbo].[SC_Users]" +
                     "SET [EmployeeNumber] = @EmployeeNumber" +
                     ",[WindowsUser] = @User" +
                     ",[FirstName] = @Name" +
                     ",[LastName] = @LastName" +
                     ",[Email] = @email" +
                     ",[LastUpdated] = GETDATE()" +
                     "WHERE WindowsUser = @User";

            objSQLCommand = new DataAccessNet.Command(strSQL);
            objSQLCommand.AddParameter("@EmployeeNumber", DataAccessNet.Command.ParameterType.Int, EmployeeNumber);
            objSQLCommand.AddParameter("@User", DataAccessNet.Command.ParameterType.VarChar, User);
            objSQLCommand.AddParameter("@Name", DataAccessNet.Command.ParameterType.VarChar, Name);
            objSQLCommand.AddParameter("@LastName", DataAccessNet.Command.ParameterType.VarChar, LastName);
            objSQLCommand.AddParameter("@email", DataAccessNet.Command.ParameterType.VarChar, email);
            try
            {
                ds = objCom.SelectResults(strSQLServer, strDataBase, objSQLCommand);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                ds = null;
            }
            return(ds);
        }
Ejemplo n.º 16
0
        public DataSet GetUserCustomer(string strSQLServer, string strDataBase, string User, int PKCustomer)
        {
            DataSet ds = new DataSet();

            DataAccessNet.SQLDataSet objCom        = new DataAccessNet.SQLDataSet();
            DataAccessNet.Command    objSQLCommand = default(DataAccessNet.Command);
            string strSQL = null;

            strSQL = "SELECT [PKUserCustomer]" +
                     ",[FKUser]" +
                     ",[FKCustomer]" +
                     " FROM [ValeoApps].[dbo].[SC_UserCustomer] UC (NOLOCK)" +
                     " INNER JOIN SC_Users U ON U.PKUser = UC.FKUser " +
                     " WHERE U.[WindowsUser] = @User AND FKCustomer = @PKCUstomer";

            objSQLCommand = new DataAccessNet.Command(strSQL);
            objSQLCommand.AddParameter("@User", DataAccessNet.Command.ParameterType.NChar, User);
            objSQLCommand.AddParameter("@PKCustomer", DataAccessNet.Command.ParameterType.Int, PKCustomer);

            try
            {
                ds = objCom.SelectResults(strSQLServer, strDataBase, objSQLCommand);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                ds = null;
            }
            return(ds);
        }
Ejemplo n.º 17
0
        public DataSet checkIfAssyLocallyExists(string strSQLServer, string strDataBase, string Assy, int FKCustomer)
        {
            DataSet ds = new DataSet();

            DataAccessNet.SQLDataSet objCom        = new DataAccessNet.SQLDataSet();
            DataAccessNet.Command    objSQLCommand = default(DataAccessNet.Command);
            string strSQL = null;

            strSQL = "SELECT [PKAssembly]" +
                     ",[Assembly]" +
                     ",[Rows]" +
                     ",[Columns]" +
                     ",[FKCustomer]" +
                     ",[FKUserUpdater]" +
                     ",[LastUpdated]" +
                     ",[Available]" +
                     ",PalletID" +
                     " FROM CT_Assemblies" +
                     " WHERE [Assembly] = @Assy AND FKCustomer = @FKCustomer";
            objSQLCommand = new DataAccessNet.Command(strSQL);
            objSQLCommand.AddParameter("@Assy", DataAccessNet.Command.ParameterType.NChar, Assy);
            objSQLCommand.AddParameter("@FKCustomer", DataAccessNet.Command.ParameterType.Int, FKCustomer);

            try
            {
                ds = objCom.SelectResults(strSQLServer, strDataBase, objSQLCommand);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                ds = null;
            }
            return(ds);
        }
Ejemplo n.º 18
0
        public DataSet RegisterUserCustomer(string strSQLServer, string strDataBase, int PKUser, int PKCustomer)
        {
            DataSet ds = new DataSet();

            DataAccessNet.SQLDataSet objCom        = new DataAccessNet.SQLDataSet();
            DataAccessNet.Command    objSQLCommand = default(DataAccessNet.Command);
            string strSQL = null;

            strSQL = "INSERT INTO [dbo].[SC_UserCustomer]" +
                     "([FKUser]" +
                     ",[FKCustomer])" +
                     " VALUES" +
                     "(@PKUser" +
                     ",@PKCustomer)";

            objSQLCommand = new DataAccessNet.Command(strSQL);
            objSQLCommand.AddParameter("@PKUser", DataAccessNet.Command.ParameterType.Int, PKUser);
            objSQLCommand.AddParameter("@PKCustomer", DataAccessNet.Command.ParameterType.Int, PKCustomer);
            try
            {
                ds = objCom.SelectResults(strSQLServer, strDataBase, objSQLCommand);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                ds = null;
            }
            return(ds);
        }
Ejemplo n.º 19
0
        public void UpdateCounter(string strSQLServer, string strDataBase, string FKFixture, int NumberOfCycles, int AccumulatedCycles,
                                  int CycleLimit, int MaintenanceCycles, int MaintenanceCyclesLimit, DateTime LastUpdated, int FKUserUpdater)
        {
            DataSet ds = new DataSet();

            DataAccessNet.SQLDataSet objCom        = new DataAccessNet.SQLDataSet();
            DataAccessNet.Command    objSQLCommand = default(DataAccessNet.Command);
            string strSQL = null;

            strSQL        = "EXEC up_ChgPaceLineCyclesGral @FKFixture, @NumberOfCycles, @AccumulatedCycles, @CycleLimit, @MaintenanceCycles, @MaintenanceCyclesLimit, @LastUpdated, @FKUserUpdater";
            objSQLCommand = new DataAccessNet.Command(strSQL);
            objSQLCommand.AddParameter("@FKFixture", DataAccessNet.Command.ParameterType.VarChar, FKFixture);
            objSQLCommand.AddParameter("@NumberOfCycles", DataAccessNet.Command.ParameterType.Int, NumberOfCycles);
            objSQLCommand.AddParameter("@AccumulatedCycles", DataAccessNet.Command.ParameterType.Int, AccumulatedCycles);
            objSQLCommand.AddParameter("@CycleLimit", DataAccessNet.Command.ParameterType.Int, CycleLimit);
            objSQLCommand.AddParameter("@MaintenanceCycles", DataAccessNet.Command.ParameterType.Int, MaintenanceCycles);
            objSQLCommand.AddParameter("@MaintenanceCyclesLimit", DataAccessNet.Command.ParameterType.Int, MaintenanceCyclesLimit);
            objSQLCommand.AddParameter("@LastUpdated", DataAccessNet.Command.ParameterType.DateTime, LastUpdated);
            objSQLCommand.AddParameter("@FKUserUpdater", DataAccessNet.Command.ParameterType.Int, FKUserUpdater);

            try
            {
                ds = objCom.SelectResults(strSQLServer, strDataBase, objSQLCommand);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                ds = null;
            }
            //return ds;
        }
Ejemplo n.º 20
0
        public DataSet checkIfAssyExists(string strSQLServer, string strDataBase, string Assy, string Customer)
        {
            DataSet ds = new DataSet();

            DataAccessNet.SQLDataSet objCom        = new DataAccessNet.SQLDataSet();
            DataAccessNet.Command    objSQLCommand = default(DataAccessNet.Command);
            string strSQL = null;

            strSQL = "SELECT [Assembly_ID]" +
                     ",[Assembly]" +
                     ",[Number]" +
                     ",[Revision]" +
                     ",[Version]" +
                     ",[Descr]" +
                     ",[Phantom]" +
                     ",[BOM_ID]" +
                     ",[EffectiveFrom]" +
                     ",[EffectiveTo]" +
                     ",[Active]" +
                     ",[Customer]" +
                     ",[Panel_ID]" +
                     ",[Family_ID]" +
                     ",[BarcodeMask_ID]" +
                     ",[UseMultiPartBarcode]" +
                     ",[UserID_ID]" +
                     ",[LastUpdated]" +
                     ",[BuildStatus_ID]" +
                     ",[CustomerNumber]" +
                     ",[CustomerRevision]" +
                     ",[AssemblyFilter1]" +
                     ",[AssemblyFilter2]" +
                     " FROM CHISQLV10A.[JEMS].[dbo].[CR_Assemblies]" +
                     " INNER JOIN CHISQLV10A.[JEMS].[dbo].CR_Customer_V ON CR_Customer_V.Customer_ID = CR_Assemblies.Customer_ID" +
                     " WHERE Number = @Assy AND Customer = @Customer AND Active = 1  AND Number NOT LIKE '% %'";
            objSQLCommand = new DataAccessNet.Command(strSQL);
            objSQLCommand.AddParameter("@Assy", DataAccessNet.Command.ParameterType.NChar, Assy);
            objSQLCommand.AddParameter("@Customer", DataAccessNet.Command.ParameterType.NChar, Customer);

            try
            {
                ds = objCom.SelectResults(strSQLServer, strDataBase, objSQLCommand);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                ds = null;
            }
            return(ds);
        }
Ejemplo n.º 21
0
        public DataSet GetLinkPath(string strSQLServer, string strDataBase, string FKCustomer, int Available)
        {
            DataSet ds = new DataSet();

            DataAccessNet.SQLDataSet objCom        = new DataAccessNet.SQLDataSet();
            DataAccessNet.Command    objSQLCommand = default(DataAccessNet.Command);
            string strSQL = null;

            strSQL = "SELECT L.[PKLinkPath] " +
                     ",L.[FKCustomer] " +
                     ",L.[FKLevel] " +
                     ",S.[Shift] " +
                     ",L.[Name] " +
                     ",L.[Phone] " +
                     ",[User] = U.[FirstName] + ' ' + U.[LastName] " +
                     ",L.[LastUpdated] " +
                     ",L.[Available] " +
                     "FROM [ValeoApps].[dbo].CT_LinkPath L (NOLOCK) " +
                     "INNER JOIN [ValeoApps].[dbo].CT_Shifts S (NOLOCK) ON L.FKShift = S.PKShift " +
                     "INNER JOIN [ValeoApps].[dbo].SC_Users U (NOLOCK) ON L.FKUserUpdater = U.PKUser " +
                     "INNER JOIN [ValeoApps].[dbo].CT_Customers C (NOLOCK) ON L.FKCustomer = c.PKCustomer " +
                     "INNER JOIN [ValeoApps].[dbo].CT_Level N (NOLOCK) ON L.FKLevel = N.PKLevel " +
                     "WHERE L.FKCustomer = @FKCustomer ";

            if (Available == 1)
            {
                strSQL += "AND L.[Available] = @Available ";
            }

            strSQL += "ORDER BY FKLevel ASC";

            objSQLCommand = new DataAccessNet.Command(strSQL);
            objSQLCommand.AddParameter("@FKCustomer", DataAccessNet.Command.ParameterType.Int, FKCustomer);
            if (Available == 1)
            {
                objSQLCommand.AddParameter("@Available", DataAccessNet.Command.ParameterType.Bit, true);
            }
            try
            {
                ds = objCom.SelectResults(strSQLServer, strDataBase, objSQLCommand);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                ds = null;
            }
            return(ds);
        }
Ejemplo n.º 22
0
        public DataSet CheckIfHaveAccess(string strSQLServer, string strDataBase, int PKUser)
        {
            DataSet ds = new DataSet();

            DataAccessNet.SQLDataSet objCom        = new DataAccessNet.SQLDataSet();
            DataAccessNet.Command    objSQLCommand = default(DataAccessNet.Command);
            string strSQL = null;

            strSQL = "SELECT [PKUserApplication]" +
                     ",[FKUser]" +
                     ",[FKApplication]" +
                     ",[HasAccess]" +
                     ",[FKUserUpdater]" +
                     ",[LastUpdated]" +
                     ",[Available]" +
                     " FROM [ValeoApps].[dbo].[SC_UserApplication]" +
                     " WHERE FKUser = @PKUser AND FKApplication = 5";

            objSQLCommand = new DataAccessNet.Command(strSQL);
            objSQLCommand.AddParameter("@PKUser", DataAccessNet.Command.ParameterType.Int, PKUser);

            try
            {
                ds = objCom.SelectResults(strSQLServer, strDataBase, objSQLCommand);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                ds = null;
            }
            return(ds);
        }
Ejemplo n.º 23
0
        public DataSet DeleteAssemblyUpd(string strSQLServer, string strDataBase, int PKAssy)
        {
            DataSet ds = new DataSet();

            DataAccessNet.SQLDataSet objCom        = new DataAccessNet.SQLDataSet();
            DataAccessNet.Command    objSQLCommand = default(DataAccessNet.Command);
            string strSQL = null;

            strSQL        = "EXEC up_DelAssemblyUpd @PKAssembly";
            objSQLCommand = new DataAccessNet.Command(strSQL);

            objSQLCommand.AddParameter("@PKAssembly", DataAccessNet.Command.ParameterType.Int, PKAssy);



            try
            {
                ds = objCom.SelectResults(strSQLServer, strDataBase, objSQLCommand);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                ds = null;
            }
            return(ds);
        }
Ejemplo n.º 24
0
        public DataSet GetWIPID(string strSQLServer, string strDataBase, string Serial)
        {
            DataSet ds = new DataSet();

            DataAccessNet.SQLDataSet objCom        = new DataAccessNet.SQLDataSet();
            DataAccessNet.Command    objSQLCommand = default(DataAccessNet.Command);
            string strSQL = null;

            strSQL = "SELECT [Wip_ID]" +
                     " FROM CHISQLV10A.[JEMS].[dbo].[WP_Wip]" +
                     " WHERE SerialNumber = @Serial";
            objSQLCommand = new DataAccessNet.Command(strSQL);
            objSQLCommand.AddParameter("@Serial", DataAccessNet.Command.ParameterType.NChar, Serial);

            try
            {
                ds = objCom.SelectResults(strSQLServer, strDataBase, objSQLCommand);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                ds = null;
            }
            return(ds);
        }
Ejemplo n.º 25
0
        public DataSet ShowAssemblies(string strSQLServer, string strDataBase, int Customer)
        {
            DataSet ds = new DataSet();

            DataAccessNet.SQLDataSet objCom        = new DataAccessNet.SQLDataSet();
            DataAccessNet.Command    objSQLCommand = default(DataAccessNet.Command);
            string strSQL = null;

            strSQL = "SELECT TOP 1000 [PKAssembly]" +
                     ",[Assembly]" +
                     ",[Rows]" +
                     ",[Columns]" +
                     ",[Rows] * [Columns] as Pieces" +
                     ",[FKCustomer]" +
                     ",U.FirstName + ' ' + U.LastName as UserUpdater" +
                     ",A.[LastUpdated]" +
                     ",PalletID" +
                     " FROM [ValeoApps].[dbo].[CT_Assemblies] A" +
                     " INNER JOIN SC_Users U ON U.PKUser = A.FKUserUpdater" +
                     " WHERE FKCustomer = @Customer";
            objSQLCommand = new DataAccessNet.Command(strSQL);
            objSQLCommand.AddParameter("@Customer", DataAccessNet.Command.ParameterType.Int, Customer);

            try
            {
                ds = objCom.SelectResults(strSQLServer, strDataBase, objSQLCommand);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                ds = null;
            }
            return(ds);
        }
Ejemplo n.º 26
0
        public DataSet InsertAssembly(string strSQLServer, string strDataBase, int Updater, string Assy, int Rows, int Columns, int FKCustomer, string PalletID)
        {
            DataSet ds = new DataSet();

            DataAccessNet.SQLDataSet objCom        = new DataAccessNet.SQLDataSet();
            DataAccessNet.Command    objSQLCommand = default(DataAccessNet.Command);
            string strSQL = null;

            strSQL        = "EXEC up_AddAssembly @Updater, @Assy, @Rows, @Columns, @FKCustomer, @PalletID";
            objSQLCommand = new DataAccessNet.Command(strSQL);
            objSQLCommand.AddParameter("@Updater", DataAccessNet.Command.ParameterType.Int, Updater);
            objSQLCommand.AddParameter("@Assy", DataAccessNet.Command.ParameterType.NChar, Assy);
            objSQLCommand.AddParameter("@Rows", DataAccessNet.Command.ParameterType.Int, Rows);
            objSQLCommand.AddParameter("@Columns", DataAccessNet.Command.ParameterType.Int, Columns);
            objSQLCommand.AddParameter("@FKCustomer", DataAccessNet.Command.ParameterType.Int, FKCustomer);
            objSQLCommand.AddParameter("@PalletID", DataAccessNet.Command.ParameterType.NChar, PalletID);

            try
            {
                ds = objCom.SelectResults(strSQLServer, strDataBase, objSQLCommand);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                ds = null;
            }
            return(ds);
        }
Ejemplo n.º 27
0
        public DataSet LinkNonUniqueComponent(string strSQLServer, string strDataBase, int WipID, string LinkData, int LinkMaterialID, string User, int RouteStepID, int EquipmentID)
        {
            DataSet ds = new DataSet();

            DataAccessNet.SQLDataSet objCom        = new DataAccessNet.SQLDataSet();
            DataAccessNet.Command    objSQLCommand = default(DataAccessNet.Command);
            string strSQL = null;

            strSQL        = "EXEC up_LinkNonUniqueComponent @WipID, @LinkData, @LinkMaterialID, @User, @RouteStepID, @EquipmentID";
            objSQLCommand = new DataAccessNet.Command(strSQL);
            objSQLCommand.AddParameter("@WipID", DataAccessNet.Command.ParameterType.Int, WipID);
            objSQLCommand.AddParameter("@LinkData", DataAccessNet.Command.ParameterType.NChar, LinkData);
            objSQLCommand.AddParameter("@LinkMaterialID", DataAccessNet.Command.ParameterType.Int, LinkMaterialID);
            objSQLCommand.AddParameter("@User", DataAccessNet.Command.ParameterType.NChar, User);
            objSQLCommand.AddParameter("@RouteStepID", DataAccessNet.Command.ParameterType.Int, RouteStepID);
            objSQLCommand.AddParameter("@EquipmentID", DataAccessNet.Command.ParameterType.Int, EquipmentID);

            try
            {
                ds = objCom.SelectResults(strSQLServer, strDataBase, objSQLCommand);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                ds = null;
            }
            return(ds);
        }
Ejemplo n.º 28
0
        public DataSet RegisterUser(string strSQLServer, string strDataBase, int EmployeeNumber, string User, string Name, string LastName, string email)
        {
            DataSet ds = new DataSet();

            DataAccessNet.SQLDataSet objCom        = new DataAccessNet.SQLDataSet();
            DataAccessNet.Command    objSQLCommand = default(DataAccessNet.Command);
            string strSQL = null;

            strSQL = "INSERT INTO [dbo].[SC_Users]" +
                     "([EmployeeNumber]" +
                     ",[WindowsUser]" +
                     ",[FirstName]" +
                     ",[LastName]" +
                     ",[Email])" +
                     " VALUES" +
                     "(@EmployeeNumber" +
                     ",@User" +
                     ",@Name" +
                     ",@LastName" +
                     ",@email)";

            objSQLCommand = new DataAccessNet.Command(strSQL);
            objSQLCommand.AddParameter("@EmployeeNumber", DataAccessNet.Command.ParameterType.Int, EmployeeNumber);
            objSQLCommand.AddParameter("@User", DataAccessNet.Command.ParameterType.VarChar, User);
            objSQLCommand.AddParameter("@Name", DataAccessNet.Command.ParameterType.VarChar, Name);
            objSQLCommand.AddParameter("@LastName", DataAccessNet.Command.ParameterType.VarChar, LastName);
            objSQLCommand.AddParameter("@email", DataAccessNet.Command.ParameterType.VarChar, email);
            try
            {
                ds = objCom.SelectResults(strSQLServer, strDataBase, objSQLCommand);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                ds = null;
            }
            return(ds);
        }
Ejemplo n.º 29
0
        public DataSet GetFixtureStatus(string strSQLServer, string strDataBase, string Fixture, string Customer)
        {
            DataSet ds = new DataSet();

            DataAccessNet.SQLDataSet objCom        = new DataAccessNet.SQLDataSet();
            DataAccessNet.Command    objSQLCommand = default(DataAccessNet.Command);
            string strSQL = null;

            strSQL        = "EXEC [dbo].[up_CheckFixtureMaintenanceStatusOnFCS] @Fixture, @Customer";
            objSQLCommand = new DataAccessNet.Command(strSQL);
            objSQLCommand.AddParameter("@Fixture", DataAccessNet.Command.ParameterType.NChar, Fixture);
            objSQLCommand.AddParameter("@Customer", DataAccessNet.Command.ParameterType.NChar, Customer);
            try
            {
                ds = objCom.SelectResults(strSQLServer, strDataBase, objSQLCommand);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                ds = null;
            }
            return(ds);
        }
Ejemplo n.º 30
0