private Boolean ShowListByLine()
    {
        
        string line = this.cmbSMTMantainTableLine.InnerDropDownList.SelectedValue;
        this.cmdMaintainSMTDashboardRefreshTime.SmtLine = line;
        this.cmdMaintainSMTDashboardStation.SmtLine = line;
        try
        {
            SMT_DashBoard_MantainInfo condition = new SMT_DashBoard_MantainInfo();
            condition.line = line;
            IList<SMT_DashBoard_MantainInfo> dataList = iSA_SMTDashboard.GetSMTDashBoardLineListByCondition(condition);
            if (dataList == null || dataList.Count == 0)
            {
                bindTable(null, DEFAULT_ROWS);
            }
            else
            {
                bindTable(dataList, DEFAULT_ROWS);
            }
        }
        catch (FisException ex)
        {
            bindTable(null, DEFAULT_ROWS);
            showErrorMessage(ex.mErrmsg);
            return false;
        }
        catch (Exception ex)
        {
            //show error
            bindTable(null, DEFAULT_ROWS);
            showErrorMessage(ex.Message);
            return false;
        }

        return true;

    }
Exemple #2
0
       public void AddOrUpDateSMTDashboardRefreshTimeAndStation(SMT_DashBoard_MantainInfo condition, string DBConnection)
       {
           string methodName = MethodBase.GetCurrentMethod().Name;

           BaseLog.LoggingBegin(logger, methodName);

           try
           {

               string SQL = @"if exists(select * from SMT_Dashboard_Line_RefreshTime_Station where Line=@line)
                                           Update SMT_Dashboard_Line_RefreshTime_Station Set RefreshTime=@refreshtime,
                                                  Station=@station,Editor=@editor,Udt=getdate()
                                            where Line=@line
                                         else
                                           Insert SMT_Dashboard_Line_RefreshTime_Station
                                             Values(@line,@refreshtime,@station,@editor,getdate(),getdate())";

               SQLHelper.ExecuteNonQuery(DBConnection,
                                               System.Data.CommandType.Text,
                                               SQL,
                                               SQLHelper.CreateSqlParameter("@line", 1024, condition.line),
                                               SQLHelper.CreateSqlParameter("@refreshtime", condition.refreshTime),
                                               SQLHelper.CreateSqlParameter("@station", 1024, condition.station),
                                               SQLHelper.CreateSqlParameter("@editor", 1024, condition.editor)
                                               );

           }
           catch (Exception)
           {
               throw;
           }
           finally
           {
               BaseLog.LoggingEnd(logger, methodName);
           }
       
       }
    protected void btnSave_ServerClick(Object sender, EventArgs e)
    {
        string id = this.HidID.Value.Trim();
        string cdt = this.Hcdt.Value.Trim();
        string lineValue = this.cmbSMTMantainTableLine.InnerDropDownList.SelectedValue.Trim();
        string stationValue = this.cmdMaintainSMTDashboardStation.InnerDropDownList.SelectedValue.Trim();
        string durTimeValue = this.dDurTime.Text.Trim();
        string refreshTimeValue = this.cmdMaintainSMTDashboardRefreshTime.InnerDropDownList.SelectedValue;
        string StandardOutputValue = this.dStandardOutput.Text.Trim();
        try
        {
            SMT_DashBoard_MantainInfo condition = new SMT_DashBoard_MantainInfo();
           
            
            if (id != "")
            {
                condition.id = Convert.ToInt32(id);
                condition.line = lineValue;
                condition.refreshTime = Convert.ToInt32(refreshTimeValue);
                condition.station = stationValue;
                condition.editor = userName;
                condition.StandardOutputCdt = Convert.ToDateTime(cdt);
            }
            else
            {
                condition.line = lineValue;
                condition.durTime = durTimeValue;
                condition.refreshTime = Convert.ToInt32(refreshTimeValue);
                if (StandardOutputValue != "")
                {
                    condition.standardOutput = Convert.ToInt32(StandardOutputValue);
                }
                condition.station = stationValue;
                condition.editor = userName;
            }
            //先对SMT_Dashboard_Line_RefreshTime_Station表进行Insert或update
            iSA_SMTDashboard.AddOrUpDateSMTDashboardRefreshTimeAndStation(condition, connectionStr);
            if (refreshTimeValue == "" || StandardOutputValue == "")
            {    
                return;
            }
            IList<SMT_DashBoard_MantainInfo> InfoList = iSA_SMTDashboard.GetSMTDashBoardLineListByCondition(condition);

            SMT_DashBoard_MantainInfo addEditInfo = new SMT_DashBoard_MantainInfo();
            if (InfoList.Count >= 12&&id=="")
            {
                showErrorMessage(pmtMessage6);
                return;
            }
            if (InfoList.Count == 0)
            {
                addEditInfo.line = lineValue;
                addEditInfo.durTime = durTimeValue;
                addEditInfo.standardOutput = Convert.ToInt32(StandardOutputValue);
                addEditInfo.editor = userName;
                iSA_SMTDashboard.AddSMTDashboardInfo(addEditInfo);
            }
            
            else
            {
                addEditInfo.id = Convert.ToInt32(id);
                addEditInfo.line = lineValue;
                addEditInfo.durTime = durTimeValue;
                addEditInfo.editor = userName;
                addEditInfo.standardOutput = Convert.ToInt32(StandardOutputValue);
                addEditInfo.StandardOutputCdt = Convert.ToDateTime(cdt);
                iSA_SMTDashboard.UpdateSMTDashBoardInfo(addEditInfo);
            }
        }
        catch (FisException ex)
        {
            showErrorMessage(ex.mErrmsg);
            return;
        }
        catch (Exception ex)
        {
            showErrorMessage(ex.Message);
            return;
        }
        finally
        {
            initLabel();
            //initcmbSMTMantainTableLineList();
            //this.updatePanel1.Update();
            this.updatePanel2.Update();
            ScriptManager.RegisterStartupScript(this.updatePanelAll, typeof(System.Object), "saveUpdate", "DealHideWait();", true);
        }
    }
Exemple #4
0
       public IList<SMT_DashBoard_MantainInfo> GetSMTDashBoardRefreshTimeAndStationByLine(SMT_DashBoard_MantainInfo condition)
       {
           string methodName = MethodBase.GetCurrentMethod().Name;

           BaseLog.LoggingBegin(logger, methodName);

           IList<SMT_DashBoard_MantainInfo> ret = new List<SMT_DashBoard_MantainInfo>();
           try
           {

               using (UnitOfWork uow = new UnitOfWork())
               {
                   ret = (from SMTRefreshTimeStation in SMTLineRefreshTimeStationtRep.Query()
                          where SMTRefreshTimeStation.Line ==condition.line
                          select new SMT_DashBoard_MantainInfo { line = SMTRefreshTimeStation.Line, refreshTime = SMTRefreshTimeStation.RefreshTime, station = SMTRefreshTimeStation.Station }).Distinct().ToList();

               }

               return ret;
           }
           catch (Exception)
           {
               throw;
           }
           finally
           {
               BaseLog.LoggingEnd(logger, methodName);
           }
       }
Exemple #5
0
       public void UpdateSMTDashBoardInfo(SMT_DashBoard_MantainInfo conditicon)
       {
           string methodName = MethodBase.GetCurrentMethod().Name;
           logger.DebugFormat("BEGIN: {0}()", methodName);
           SMT_Dashboard_Line_Time_Qty smtDashBoardMaintain = new SMT_Dashboard_Line_Time_Qty();
           try
           {
               using (UnitOfWork uow = new UnitOfWork())
               {

                   smtDashBoardMaintain.ID = conditicon.id;
                   smtDashBoardMaintain.Line = conditicon.line;
                   smtDashBoardMaintain.Qty = conditicon.standardOutput;
                   smtDashBoardMaintain.DurTime = conditicon.durTime;
                   smtDashBoardMaintain.Editor = conditicon.editor;
                   smtDashBoardMaintain.Cdt = conditicon.StandardOutputCdt;
                   smtDashBoardMaintain.Udt = DateTime.Now;
                   SMTDashBoardRep.Update(smtDashBoardMaintain);
                   uow.Commit();
               }
              
           }
           catch (Exception e)
           {
               BaseLog.LoggingError(logger, MethodBase.GetCurrentMethod(), e);
               throw;
           }
           finally
           {
               BaseLog.LoggingEnd(logger, methodName);
           }
       
       }
Exemple #6
0
 public void AddSMTDashboardInfo(SMT_DashBoard_MantainInfo conditicon)
 {
     string methodName = MethodBase.GetCurrentMethod().Name;
     logger.DebugFormat("BEGIN: {0}()", methodName);
     try
     {
         using (UnitOfWork uow = new UnitOfWork())
         {
             SMT_Dashboard_Line_Time_Qty smtDashBoardMaintain = new SMT_Dashboard_Line_Time_Qty();
             SMT_Dashboard_Result smtDashboardResult = new SMT_Dashboard_Result();
             smtDashBoardMaintain.Line = conditicon.line;
             smtDashBoardMaintain.Qty = conditicon.standardOutput;
             smtDashBoardMaintain.DurTime = "08:00--10:00";
             smtDashBoardMaintain.Editor = conditicon.editor;
             smtDashBoardMaintain.Cdt = DateTime.Now;
             smtDashBoardMaintain.Udt = DateTime.Now;
             smtDashboardResult.Line = conditicon.line;
             smtDashboardResult.DurTime = "08:00--10:00";
             SMTDashBoardRep.Insert(smtDashBoardMaintain); // 将数据塞入Maintain 表中
             SMTDashBoardResultRep.Insert(smtDashboardResult);//将Line和时间段塞入 结果表中
             uow.Commit();
             smtDashBoardMaintain.DurTime = "10:00--12:00";
             smtDashboardResult.DurTime = "10:00--12:00";
             SMTDashBoardRep.Insert(smtDashBoardMaintain);
             SMTDashBoardResultRep.Insert(smtDashboardResult);
             uow.Commit();
             smtDashBoardMaintain.DurTime = "12:00--14:00";
             smtDashboardResult.DurTime = "12:00--14:00";
             SMTDashBoardRep.Insert(smtDashBoardMaintain);
             SMTDashBoardResultRep.Insert(smtDashboardResult);
             uow.Commit();
             smtDashBoardMaintain.DurTime = "14:00--16:00";
             smtDashboardResult.DurTime = "14:00--16:00";
             SMTDashBoardRep.Insert(smtDashBoardMaintain);
             SMTDashBoardResultRep.Insert(smtDashboardResult);
             uow.Commit();
             smtDashBoardMaintain.DurTime = "16:00--18:00";
             smtDashboardResult.DurTime = "16:00--18:00";
             SMTDashBoardRep.Insert(smtDashBoardMaintain);
             SMTDashBoardResultRep.Insert(smtDashboardResult);
             uow.Commit();
             smtDashBoardMaintain.DurTime = "18:00--20:30";
             smtDashboardResult.DurTime = "18:00--20:30";
             SMTDashBoardRep.Insert(smtDashBoardMaintain);
             SMTDashBoardResultRep.Insert(smtDashboardResult);
             uow.Commit();
             smtDashBoardMaintain.DurTime = "20:30--22:00";
             smtDashboardResult.DurTime = "20:30--22:00";
             SMTDashBoardRep.Insert(smtDashBoardMaintain);
             SMTDashBoardResultRep.Insert(smtDashboardResult);
             uow.Commit();
             smtDashBoardMaintain.DurTime = "22:00--00:00";
             smtDashboardResult.DurTime = "22:00--00:00";
             SMTDashBoardRep.Insert(smtDashBoardMaintain);
             SMTDashBoardResultRep.Insert(smtDashboardResult);
             uow.Commit();
             smtDashBoardMaintain.DurTime = "00:00--02:00";
             smtDashboardResult.DurTime = "00:00--02:00";
             SMTDashBoardRep.Insert(smtDashBoardMaintain);
             SMTDashBoardResultRep.Insert(smtDashboardResult);
             uow.Commit();
             smtDashBoardMaintain.DurTime = "02:00--04:00";
             smtDashboardResult.DurTime = "02:00--04:00";
             SMTDashBoardRep.Insert(smtDashBoardMaintain);
             SMTDashBoardResultRep.Insert(smtDashboardResult);
             uow.Commit();
             smtDashBoardMaintain.DurTime = "04:00--06:00";
             smtDashboardResult.DurTime = "04:00--06:00";
             SMTDashBoardRep.Insert(smtDashBoardMaintain);
             SMTDashBoardResultRep.Insert(smtDashboardResult);
             uow.Commit();
             smtDashBoardMaintain.DurTime = "06:00--08:00";
             smtDashboardResult.DurTime = "06:00--08:00";
             SMTDashBoardRep.Insert(smtDashBoardMaintain);
             SMTDashBoardResultRep.Insert(smtDashboardResult);
             uow.Commit();
         }
         
     }
     catch (Exception e)
     {
         BaseLog.LoggingError(logger, MethodBase.GetCurrentMethod(), e);
         throw;
     }
     finally
     {
         BaseLog.LoggingEnd(logger, methodName);
     }
 
 }
Exemple #7
0
       public IList<SMT_DashBoard_MantainInfo> GetSMTDashBoardLineListById(SMT_DashBoard_MantainInfo condition)
       {
           string methodName = MethodBase.GetCurrentMethod().Name;

           BaseLog.LoggingBegin(logger, methodName);

           IList<SMT_DashBoard_MantainInfo> ret = new List<SMT_DashBoard_MantainInfo>();
           try
           {

               using (UnitOfWork uow = new UnitOfWork())
               {
                       ret = (from SMTDashboard in SMTDashBoardRep.Query()
                              where SMTDashboard.ID ==Convert.ToInt32(condition.id)
                              select new SMT_DashBoard_MantainInfo { id = SMTDashboard.ID, line = SMTDashboard.Line, durTime = SMTDashboard.DurTime, standardOutput = SMTDashboard.Qty }).Distinct().ToList();
                   
               }

               return ret;
           }
           catch (Exception)
           {
               throw;
           }
           finally
           {
               BaseLog.LoggingEnd(logger, methodName);
           }
       }
Exemple #8
0
       public IList<SMT_DashBoard_MantainInfo> GetSMTDashBoardLineListByCondition(SMT_DashBoard_MantainInfo condition)
       {
           string methodName = MethodBase.GetCurrentMethod().Name;

           BaseLog.LoggingBegin(logger, methodName);

           IList<SMT_DashBoard_MantainInfo> ret = new List<SMT_DashBoard_MantainInfo>();
           try
           {

               using (UnitOfWork uow = new UnitOfWork())
               {
                       ret = (from SMTDashboard in SMTDashBoardRep.Query()
                              where SMTDashboard.Line==condition.line
                              select new SMT_DashBoard_MantainInfo { id = SMTDashboard.ID, line = SMTDashboard.Line, durTime = SMTDashboard.DurTime, standardOutput = SMTDashboard.Qty,editor=SMTDashboard.Editor,StandardOutputCdt=SMTDashboard.Cdt,StandardOutputUdt=SMTDashboard.Udt}).OrderBy(x=>x.line).Distinct().ToList();
               }

               return ret;
           }
           catch (Exception)
           {
               throw;
           }
           finally
           {
               BaseLog.LoggingEnd(logger, methodName);
           }
       }