Пример #1
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                // 初始化页面语言
                this.InitPageLanguage(this.languageComponent1, false);

                if (_shelfFacade == null)
                {
                    _shelfFacade = new FacadeFactory(base.DataProvider).CreateShelfFacade();
                }
                object volumn = _shelfFacade.GetBurnInOutVolumn(Guid.Empty.ToString());
                if (volumn == null)
                {
                    volumn = _shelfFacade.CreateNewBurnInOutVolumn();
                    (volumn as BurnInOutVolumn).PKID         = Guid.Empty.ToString();
                    (volumn as BurnInOutVolumn).Total        = 0;
                    (volumn as BurnInOutVolumn).Used         = 0;
                    (volumn as BurnInOutVolumn).MaintainUser = this.GetUserCode();

                    _shelfFacade.AddBurnInOutVolumn(volumn as BurnInOutVolumn);
                }

                this.txtVolumnEdit.Text = (volumn as BurnInOutVolumn).Total.ToString("##.##");
            }
        }
Пример #2
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            shelfpk = this.GetRequestParam("ShelfPK");

            if (!Page.IsPostBack)
            {
                // 初始化页面语言
                this.InitPageLanguage(this.languageComponent1, false);

                if (_facade == null)
                {
                    _facade = new ShelfFacade(base.DataProvider);
                }
                object obj = this._facade.GetShelfActionList(shelfpk);
                if (obj == null)
                {
                    ExceptionManager.Raise(this.GetType().BaseType, "$Error_RequestUrlParameter_Lost");
                }

                this.txtShelf.Value     = ((ShelfActionList)obj).ShelfNO.ToString();
                this.txtBurnInDT.Value  = FormatHelper.TODateTimeString(((ShelfActionList)obj).BurnInDate, ((ShelfActionList)obj).BurnInTime);
                this.txtVolumn.Value    = ((ShelfActionList)obj).eAttribute1.ToString();
                this.txtBurnOutDT.Value = FormatHelper.TODateTimeString(((ShelfActionList)obj).BurnOutDate, ((ShelfActionList)obj).BurnOutTIme);
            }
        }
Пример #3
0
 protected override int GetRowCount()
 {
     if (_facade == null)
     {
         _facade = new ShelfFacade(base.DataProvider);
     }
     return(this._facade.QueryShelf2RCardCount(shelfpk));
 }
Пример #4
0
        protected override object[] LoadDataSource(int inclusive, int exclusive)
        {
            if (_facade == null)
            {
                _facade = new ShelfFacade(base.DataProvider);
            }
            object[] objs = this._facade.QueryShelf2RCard(
                shelfpk, inclusive, exclusive);

            return(objs);
        }
Пример #5
0
        protected object[] LoadDataSourceBurnIn(int inclusive, int exclusive)
        {
            ShelfFacade shelfFacade = new ShelfFacade(base.DataProvider);

            string shelfpk = this.gridHelper.Grid.Rows[0].Cells.FromKey("ShelfPK").Value.ToString();

            object[] objs = null;
            object   obj  = shelfFacade.GetShelfActionList(shelfpk);

            if (obj != null)
            {
                objs = new object[] { obj };
            }

            return(objs);
        }
Пример #6
0
        private void cmdSave_ServerClick(object sender, EventArgs e)
        {
            if (ValidateInput())
            {
                if (_shelfFacade == null)
                {
                    _shelfFacade = new FacadeFactory(base.DataProvider).CreateShelfFacade();
                }

                object volumn = _shelfFacade.GetBurnInOutVolumn(Guid.Empty.ToString());

                (volumn as BurnInOutVolumn).Total        = Convert.ToInt32(FormatHelper.CleanString(this.txtVolumnEdit.Text, 10));
                (volumn as BurnInOutVolumn).MaintainUser = this.GetUserCode();

                _shelfFacade.UpdateBurnInOutVolumn(volumn as BurnInOutVolumn);

                Alter(this.languageComponent1.GetString("$CS_Save_Success"));
            }
        }
Пример #7
0
        private void ExportQueryEvent(object sender, EventArgs e)
        {
            if (chbItemDetail.Checked)
            {
                int BurnInBeginDate  = DefaultDateTime.DefaultToInt;
                int BurnInEndDate    = DefaultDateTime.DefaultToInt;
                int BurnOutBeginDate = DefaultDateTime.DefaultToInt;
                int BurnOutEndDate   = DefaultDateTime.DefaultToInt;

                if (rdbBurnIN.Checked)
                {
                    BurnInBeginDate = FormatHelper.TODateInt(this.txtBurnInDateFrom.Text);
                    BurnInEndDate   = FormatHelper.TODateInt(this.txtBurnInDateTo.Text);
                }

                if (rdbBurnOut.Checked)
                {
                    BurnOutBeginDate = FormatHelper.TODateInt(this.txtBurnOutDateFrom.Text);
                    BurnOutEndDate   = FormatHelper.TODateInt(this.txtBurnOutDateTo.Text);
                }

                ShelfFacade shelfFacade = new ShelfFacade(base.DataProvider);

                (e as WebQueryEventArgs).GridDataSource =
                    shelfFacade.QueryShelf2RCard(
                        FormatHelper.CleanString(this.txtShelf.Text.Trim()).ToUpper(),
                        FormatHelper.CleanString(this.txtConditionItem.Text).ToUpper(),
                        FormatHelper.CleanString(this.txtConditionMo.Text).ToUpper(),
                        FormatHelper.CleanString(this.txtStartSnQuery.Text),
                        FormatHelper.CleanString(this.txtEndSnQuery.Text),
                        BurnInBeginDate, BurnInEndDate, BurnOutBeginDate, BurnOutEndDate,
                        (e as WebQueryEventArgs).StartRow,
                        (e as WebQueryEventArgs).EndRow);
            }
            else
            {
                this.QueryEvent(sender, e);
            }
        }
Пример #8
0
        private void QueryEvent(object sender, EventArgs e)
        {
            int BurnInBeginDate  = DefaultDateTime.DefaultToInt;
            int BurnInEndDate    = DefaultDateTime.DefaultToInt;
            int BurnOutBeginDate = DefaultDateTime.DefaultToInt;
            int BurnOutEndDate   = DefaultDateTime.DefaultToInt;

            if (rdbBurnIN.Checked)
            {
                BurnInBeginDate = FormatHelper.TODateInt(this.txtBurnInDateFrom.Text);
                BurnInEndDate   = FormatHelper.TODateInt(this.txtBurnInDateTo.Text);
            }

            if (rdbBurnOut.Checked)
            {
                BurnOutBeginDate = FormatHelper.TODateInt(this.txtBurnOutDateFrom.Text);
                BurnOutEndDate   = FormatHelper.TODateInt(this.txtBurnOutDateTo.Text);
            }

            ShelfFacade shelfFacade = new ShelfFacade(base.DataProvider);

            (e as WebQueryEventArgs).GridDataSource = (object[])shelfFacade.GetShelfActionListByShelfNo(
                FormatHelper.CleanString(this.txtShelf.Text.Trim()).ToUpper(),
                FormatHelper.CleanString(this.txtConditionItem.Text).ToUpper(),
                FormatHelper.CleanString(this.txtConditionMo.Text).ToUpper(),
                FormatHelper.CleanString(this.txtStartSnQuery.Text),
                FormatHelper.CleanString(this.txtEndSnQuery.Text),
                BurnInBeginDate, BurnInEndDate, BurnOutBeginDate, BurnOutEndDate,
                (e as WebQueryEventArgs).StartRow,
                (e as WebQueryEventArgs).EndRow);                   //ByShelfNo

            (e as WebQueryEventArgs).RowCount = shelfFacade.QueryShelfActionListCountByShelfNo(
                FormatHelper.CleanString(this.txtShelf.Text.Trim()).ToUpper(),
                FormatHelper.CleanString(this.txtConditionItem.Text).ToUpper(),
                FormatHelper.CleanString(this.txtConditionMo.Text).ToUpper(),
                FormatHelper.CleanString(this.txtStartSnQuery.Text),
                FormatHelper.CleanString(this.txtEndSnQuery.Text),
                BurnInBeginDate, BurnInEndDate, BurnOutBeginDate, BurnOutEndDate);
        }
Пример #9
0
        public void ucbBurnOut_Click(object sender, EventArgs e)
        {
            /* 检查车号 */
            string shelfno = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.uclShelfNO.Value));

            if (shelfno.Length == 0)
            {
                ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Error, "$CS_Please_Input_ShelfNO"));

                Application.DoEvents();
                uclShelfNO.TextFocus(true, true);
                //System.Windows.Forms.SendKeys.Send("+{TAB}");
                return;
            }

            bool expired = false;

            for (int i = 0; i < this.ultraDataSource2.Rows.Count; i++)
            {
                if (string.Compare(shelfno, this.ultraDataSource2.Rows[i]["ShelfNO2"].ToString()) == 0)
                {
                    expired = true;
                    break;
                }
            }

            if (!expired)
            {
                ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Error, "$CS_Shelf_Not_Expired"));

                Application.DoEvents();
                uclShelfNO.TextFocus(true, true);
                //System.Windows.Forms.SendKeys.Send("+{TAB}");
                return;
            }

            Messages messages = new Messages();

            if (_shelfFacade == null)
            {
                _shelfFacade = new ShelfFacade(this.DataProvider);
            }

            ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)DataProvider).PersistBroker.OpenConnection();
            DataProvider.BeginTransaction();
            try
            {
                /* step1: 改变shelf的状态 */
                object shelf = _shelfFacade.GetShelfAndLockit(shelfno);

                if (shelf == null)
                {
                    messages.Add(new UserControl.Message(MessageType.Error, "$CS_Shelf_Not_Exist"));
                    ApplicationRun.GetInfoForm().Add(messages);
                    //RefreshPanel() ;
//					this.DataProvider.RollbackTransaction();	// Added by Icyer 2006/06/13 @Darfon
                }

                if (messages.IsSuccess())
                {
                    if ((shelf as Shelf).Status == ShelfStatus.BurnOut)
                    {
                        messages.Add(new UserControl.Message(MessageType.Error, "$CS_Shelf_Has_Burn_Out"));
                        ApplicationRun.GetInfoForm().Add(messages);
                        //RefreshPanel() ;
                        //					this.DataProvider.RollbackTransaction();	// Added by Icyer 2006/06/13 @Darfon
                    }
                }

                object shelfActionList = null;
                if (messages.IsSuccess())
                {
                    (shelf as Shelf).Status       = ShelfStatus.BurnOut;
                    (shelf as Shelf).MaintainUser = ApplicationService.Current().UserCode;


                    /* step2: 记录shelf */
                    DBDateTime dbDateTime = FormatHelper.GetNowDBDateTime(DataProvider);

                    shelfActionList = _shelfFacade.GetShelfActionList(shelfno, ShelfStatus.BurnIn);
                    (shelfActionList as ShelfActionList).Status = ShelfStatus.BurnOut;
//				(shelfActionList as ShelfActionList).BurnOutDate = FormatHelper.TODateInt( DateTime.Now );
//				(shelfActionList as ShelfActionList).BurnOutTIme = FormatHelper.TOTimeInt( DateTime.Now );

                    (shelfActionList as ShelfActionList).BurnOutDate = dbDateTime.DBDate;
                    (shelfActionList as ShelfActionList).BurnOutTIme = dbDateTime.DBTime;;

                    (shelfActionList as ShelfActionList).BurnOutUser  = ApplicationService.Current().UserCode;
                    (shelfActionList as ShelfActionList).MaintainUser = ApplicationService.Current().UserCode;


                    /* step3: 车位计数,减1 */


                    /* step4: rcard burn Out */
                    string[] rcards = _shelfFacade.GetShelf2RCard((shelfActionList as ShelfActionList).PKID);
                    if (rcards != null && rcards.Length > 0)
                    {
                        for (int i = 0; i < rcards.Length; i++)
                        {
                            messages.AddMessages(RunBurnOut(rcards[i], (shelfActionList as ShelfActionList).PKID));
                            if (!messages.IsSuccess())
                            {
                                break;
                            }
                        }
                    }
                }

                if (messages.IsSuccess())
                {
                    //Laws Lu,2006/11/31 change update database sequence
                    _shelfFacade.UpdateShelf(shelf as Shelf);
                    //Laws Lu,2006/11/31 update detail data
                    _shelfFacade.UpdateShelfActionList(shelfActionList as ShelfActionList);
                    //Laws Lu,2006/11/31 车位计数
                    _shelfFacade.UpdateBurnInOutVolumnBySqlMinus(ApplicationService.Current().UserCode);


                    ApplicationRun.GetInfoForm().Add(messages);

                    DataProvider.CommitTransaction();
                    //RefreshPanel() ;
                }
                else
                {
                    DataProvider.RollbackTransaction();
                    ApplicationRun.GetInfoForm().Add(messages);
                    //RefreshPanel() ;
                }
            }
            catch (Exception ex)
            {
                DataProvider.RollbackTransaction();
                if (ex.Message.IndexOf("ORA-00054") >= 0)
                {
                    messages.Add(new UserControl.Message(MessageType.Error, "$ERR_CURRENT_SHELF_BE_LOCKED"));
                }
                else
                {
                    messages.Add(new UserControl.Message(ex));
                }
                ApplicationRun.GetInfoForm().Add(messages);
                //RefreshPanel() ;
            }
            finally
            {
                ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)DataProvider).PersistBroker.CloseConnection();
                RefreshPanel();
            }
        }
Пример #10
0
        public void RefreshPanel()
        {
            //Laws Lu,2006/12/27 减少Open/Close次数
            ((SQLDomainDataProvider)DataProvider).PersistBroker.AutoCloseConnection = false;
            ((SQLDomainDataProvider)DataProvider).PersistBroker.OpenConnection();
            if (_shelfFacade == null)
            {
                _shelfFacade = new ShelfFacade(this.DataProvider);
            }
            /* 尚未到期的 */
            this.ultraDataSource1.Rows.Clear();
            Hashtable expiredHt = _shelfFacade.GetNotExpiredShelf();

            if (expiredHt != null)
            {
                System.Data.DataTable dtExpire = new System.Data.DataTable();

                dtExpire.Columns.Add("ShelfNO1", typeof(string));
                dtExpire.Columns.Add("ResidualTime", typeof(int));
                dtExpire.Columns.Add("ShelfPosition", typeof(string));
                foreach (DictionaryEntry dic in expiredHt)
                {
                    BurnOutShelf sf   = (BurnOutShelf)dic.Value;
                    TimeSpan     span = sf.TimeSpan;
                    int          min  = span.Days * 24 * 60 + span.Hours * 60 + span.Minutes;

                    //she
                    dtExpire.Rows.Add(new object[] { sf.ShelfNO, min, sf.memo });
                    dtExpire.AcceptChanges();
                }

                System.Data.DataView dv = new System.Data.DataView(dtExpire);

                dv.Sort = "ResidualTime DESC";

                for (int i = 0; i < dv.Count; i++)
                {
//					try
//					{
                    Infragistics.Win.UltraWinDataSource.UltraDataRow row = ultraDataSource1.Rows.Add();

                    row["ShelfNO1"] = dv[i]["ShelfNO1"].ToString();

                    row["ResidualTime"] = dv[i]["ResidualTime"].ToString() + "min";

                    row["ShelfPosition"] = dv[i]["ShelfPosition"].ToString();

//					}
//					catch{}
                }
                //ultraGrid1.DisplayLayout.Override. = Infragistics.Win.UltraWinGrid.RowFilterMode.
                //ultraDataSource1.Band.Columns.
            }

            /* 已经到期的 */
            this.ultraDataSource2.Rows.Clear();
            Hashtable notExpiredHt = _shelfFacade.GetExpiredShelf();

            if (notExpiredHt != null)
            {
                ArrayList alList = new ArrayList();
                alList.AddRange(notExpiredHt.Keys);
                alList.Sort();
                foreach (object key in alList)
                {
//					try
//					{

                    Infragistics.Win.UltraWinDataSource.UltraDataRow row = ultraDataSource2.Rows.Add();

                    if (notExpiredHt.ContainsKey(key))
                    {
                        BurnOutShelf bs = (BurnOutShelf)notExpiredHt[key];
                        row["ShelfNO2"]       = bs.ShelfNO;
                        row["ShelfPosition2"] = bs.memo;
                    }

//					}
//					catch{}
                }
            }


            /* 车位数量的 */
            object volumn = _shelfFacade.GetBurnInOutVolumn(Guid.Empty.ToString());

            if (volumn != null)
            {
                this.lblTotal.Text = (volumn as BurnInOutVolumn).Total.ToString("##.##");
                this.lblUsed.Text  = (volumn as BurnInOutVolumn).Used.ToString("##.##");
                decimal residual = (volumn as BurnInOutVolumn).Total - (volumn as BurnInOutVolumn).Used;
                this.lblResidual.Text = residual.ToString("##.##");
            }

            //Laws Lu,2006/12/27 减少Open/Close次数
            ((SQLDomainDataProvider)DataProvider).PersistBroker.CloseConnection();
            ((SQLDomainDataProvider)DataProvider).PersistBroker.AutoCloseConnection = true;

            Application.DoEvents();
            this.uclShelfNO.TextFocus(true, true);
//			System.Windows.Forms.SendKeys.Send("+{TAB}");
        }