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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); } }
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); }
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); }
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); }
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); }
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); }
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; }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }