Ejemplo n.º 1
0
 public static bool GetListCom_PartOperation(Com_PEMain cCom_PEMain, out IList <Com_PartOperation> cCom_PartOperation)
 {
     cCom_PartOperation = new List <Com_PartOperation>();
     try
     {
         cCom_PartOperation = session.QueryOver <Com_PartOperation>()
                              .Where(x => x.comPEMain == cCom_PEMain)
                              .OrderBy(x => x.operation1).Asc
                              .List <Com_PartOperation>();
     }
     catch (System.Exception ex)
     {
         return(false);
     }
     return(true);
 }
Ejemplo n.º 2
0
 public static bool GetCom_PartOperation(Com_PEMain cCom_PEMain, string op1, out Com_PartOperation cCom_PartOperation)
 {
     cCom_PartOperation = new Com_PartOperation();
     try
     {
         cCom_PartOperation = session.QueryOver <Com_PartOperation>()
                              .Where(x => x.comPEMain == cCom_PEMain)
                              .Where(x => x.operation1 == op1).SingleOrDefault <Com_PartOperation>();
         if (cCom_PartOperation == null)
         {
             MessageBox.Show("資料庫無此製程序");
             return(false);
         }
     }
     catch (System.Exception ex)
     {
         MessageBox.Show("查找失敗,請檢查連線狀態");
         return(false);
     }
     return(true);
 }
Ejemplo n.º 3
0
 public static bool GetCom_PEMain(string cusName, string partName, string cusRev, string opRev, out Com_PEMain cCom_PEMain)
 {
     cCom_PEMain = new Com_PEMain();
     try
     {
         Sys_Customer cSys_Customer = session.QueryOver <Sys_Customer>().Where(x => x.customerName == cusName).SingleOrDefault();
         cCom_PEMain = session.QueryOver <Com_PEMain>()
                       .Where(x => x.sysCustomer == cSys_Customer)
                       .Where(x => x.partName == partName)
                       .Where(x => x.customerVer == cusRev)
                       .Where(x => x.opVer == opRev).SingleOrDefault();
         if (cCom_PEMain == null)
         {
             MessageBox.Show("資料庫無此料號");
             return(false);
         }
     }
     catch (System.Exception ex)
     {
         MessageBox.Show("查找失敗,請檢查連線狀態");
         return(false);
     }
     return(true);
 }