protected void cmdDelete_ServerClick(object sender, System.EventArgs e)
        {
            if (_solderPasteFacade == null)
            {
                _solderPasteFacade = new SMTFacadeFactory(base.DataProvider).CreateSolderPasteFacade();
            }
            ArrayList array = this.gridHelper.GetCheckedRows();

            if (array.Count > 0)
            {
                ArrayList objs = new ArrayList(array.Count);

                foreach (GridRecord row in array)
                {
                    object obj = this.GetEditObject(row);
                    if (obj != null)
                    {
                        objs.Add((SolderPasteControl)obj);
                    }
                }

                this._solderPasteFacade.DeleteSolderPasteControl((SolderPasteControl[])objs.ToArray(typeof(SolderPasteControl)));

                this.gridHelper.GridBind(this.pagerToolBar.PageIndex, this.pagerToolBar.PageSize);
                this.RequestData();
                this.buttonHelper.PageActionStatusHandle(PageActionType.Delete);
            }
        }
        private void SetEditObject(object obj)
        {
            if (_solderPasteFacade == null)
            {
                _solderPasteFacade = new SMTFacadeFactory(base.DataProvider).CreateSolderPasteFacade();
            }
            if (obj == null)
            {
                this.txtPartNOEdit.Text          = string.Empty;
                this.drpSPTypeEdit.SelectedIndex = 0;
                this.txtReturnTPEdit.Text        = string.Empty;
                this.txtOpenTPEdit.Text          = string.Empty;
                this.txtUnOpenTPEdit.Text        = string.Empty;
                this.txtGuanPerEdit.Text         = string.Empty;

                return;
            }

            SolderPasteControl spc = obj as SolderPasteControl;

            this.txtPartNOEdit.Text          = spc.PartNO.ToString();
            this.drpSPTypeEdit.SelectedValue = spc.Type.ToString();
            this.txtReturnTPEdit.Text        = spc.ReturnTimeSpan.ToString("##.##");
            this.txtOpenTPEdit.Text          = spc.OpenTimeSpan.ToString("##.##");
            this.txtUnOpenTPEdit.Text        = spc.UnOpenTimeSpan.ToString("##.##");
            this.txtGuanPerEdit.Text         = spc.GuaranteePeriod.ToString("##.##");
        }
        private object GetEditObject()
        {
            if (this.ValidateInput())
            {
                if (_solderPasteFacade == null)
                {
                    _solderPasteFacade = new SMTFacadeFactory(base.DataProvider).CreateSolderPasteFacade();
                }

                SolderPasteControl spc = this._solderPasteFacade.CreateNewSolderPasteControl();

                spc.PartNO          = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtPartNOEdit.Text, 40));
                spc.Type            = drpSPTypeEdit.SelectedValue;
                spc.ReturnTimeSpan  = Convert.ToDecimal(FormatHelper.CleanString(this.txtReturnTPEdit.Text));
                spc.UnOpenTimeSpan  = Convert.ToDecimal(FormatHelper.CleanString(this.txtUnOpenTPEdit.Text));
                spc.OpenTimeSpan    = Convert.ToDecimal(FormatHelper.CleanString(this.txtOpenTPEdit.Text));
                spc.GuaranteePeriod = Convert.ToInt32(FormatHelper.CleanString(this.txtGuanPerEdit.Text));
                spc.MaintainUser    = this.GetUserCode();

                return(spc);
            }
            else
            {
                return(null);
            }
        }
 private int GetRowCount()
 {
     if (_solderPasteFacade == null)
     {
         _solderPasteFacade = new SMTFacadeFactory(base.DataProvider).CreateSolderPasteFacade();
     }
     return(_solderPasteFacade.QuerySolderPasteControlCount(
                FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtPartNOQuery.Text)),
                drpSPTypeQuery.SelectedValue));
 }
        private object[] LoadDataSource(int inclusive, int exclusive)
        {
            if (_solderPasteFacade == null)
            {
                _solderPasteFacade = new SMTFacadeFactory(base.DataProvider).CreateSolderPasteFacade();
            }

            return(_solderPasteFacade.QuerySolderPasteControl(
                       FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtPartNOQuery.Text)),
                       drpSPTypeQuery.SelectedValue,
                       inclusive, exclusive));
        }
 private int GetRowCount()
 {
     if (_solderPasteFacade == null)
     {
         _solderPasteFacade = new SMTFacadeFactory(base.DataProvider).CreateSolderPasteFacade();
     }
     return(_solderPasteFacade.QuerySolderPasteCount(
                FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtSPIDQuery.Text)),
                FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtPartNOQuery.Text)),
                FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtLotNOQuery.Text)),
                drpSPStatusQuery.SelectedValue,
                FormatHelper.TODateInt(FormatHelper.CleanString(this.txtFromProDateQuery.Text)),
                FormatHelper.TODateInt(FormatHelper.CleanString(this.txtToProDateQuery.Text))));
 }
        private object GetEditObject(GridRecord row)
        {
            if (_solderPasteFacade == null)
            {
                _solderPasteFacade = new SMTFacadeFactory(base.DataProvider).CreateSolderPasteFacade();
            }

            object obj = this._solderPasteFacade.GetSolderPasteControl(row.Items.FindItemByKey("SolderPastePartNO").Text.ToString());

            if (obj != null)
            {
                return((SolderPasteControl)obj);
            }

            return(null);
        }
        protected void cmdSave_ServerClick(object sender, System.EventArgs e)
        {
            if (_solderPasteFacade == null)
            {
                _solderPasteFacade = new SMTFacadeFactory(base.DataProvider).CreateSolderPasteFacade();
            }
            object obj = this.GetEditObject();

            if (obj != null)
            {
                this._solderPasteFacade.UpdateSolderPasteControl(obj as SolderPasteControl);;
                this.gridHelper.GridBind(this.pagerToolBar.PageIndex, this.pagerToolBar.PageSize);
                this.RequestData();
                this.buttonHelper.PageActionStatusHandle(PageActionType.Save);
            }
        }
        private object[] LoadDataSource(int inclusive, int exclusive)
        {
            if (_solderPasteFacade == null)
            {
                _solderPasteFacade = new SMTFacadeFactory(base.DataProvider).CreateSolderPasteFacade();
            }

            return(_solderPasteFacade.QuerySolderPaste(
                       FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtSPIDQuery.Text)),
                       FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtPartNOQuery.Text)),
                       FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtLotNOQuery.Text)),
                       drpSPStatusQuery.SelectedValue,
                       FormatHelper.TODateInt(FormatHelper.CleanString(this.txtFromProDateQuery.Text)),
                       FormatHelper.TODateInt(FormatHelper.CleanString(this.txtToProDateQuery.Text)),
                       inclusive, exclusive));
        }
Exemple #10
0
        protected void cmdAdd_ServerClick(object sender, System.EventArgs e)
        {
            object[] objs = this.GetEditObject();
            if (objs != null && objs.Length > 0)
            {
                if (_solderPasteFacade == null)
                {
                    _solderPasteFacade = new SMTFacadeFactory(base.DataProvider).CreateSolderPasteFacade();
                }

                ArrayList array = new ArrayList(objs);
                this._solderPasteFacade.AddSolderPaste2ItemWithTransaction((SolderPaste2Item[])array.ToArray(typeof(SolderPaste2Item)));

                this.gridHelper.GridBind(this.pagerToolBar.PageIndex, this.pagerToolBar.PageSize);
                this.RequestData();
                this.buttonHelper.PageActionStatusHandle(PageActionType.Add);
            }
        }
        private object GetEditObject()
        {
            if (this.ValidateInput())
            {
                if (_solderPasteFacade == null)
                {
                    _solderPasteFacade = new SMTFacadeFactory(base.DataProvider).CreateSolderPasteFacade();
                }

                SolderPaste obj = this._solderPasteFacade.CreateNewSolderPaste();

                obj.SolderPasteID = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtSPIDEdit.Text, 40));
                obj.PartNO        = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtPartNOEdit.Text, 40));

                object spc = _solderPasteFacade.GetSolderPasteControl(obj.PartNO);
                if (spc == null)
                {
                    WebInfoPublish.Publish(this, "$Error_SolderPastePartNO_Not_Maintain", languageComponent1);
                    return(null);
                }

                obj.LotNO          = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtLotNOEdit.Text, 40));
                obj.ProductionDate = FormatHelper.TODateInt(this.txtProDateEdit.Text);

                DateTime proDate = DateTime.ParseExact(this.txtProDateEdit.Text, "yyyy-MM-dd", null);
                DateTime exDate  = proDate.AddMonths((spc as SolderPasteControl).GuaranteePeriod);
                obj.ExpiringDate = FormatHelper.TODateInt(exDate);

                obj.Used         = FormatHelper.FALSE_STRING;
                obj.Status       = SolderPasteStatus.Normal;
                obj.MaintainUser = this.GetUserCode();

                return(obj);
            }
            else
            {
                return(null);
            }
        }
        private void SetEditObject(object obj)
        {
            if (_solderPasteFacade == null)
            {
                _solderPasteFacade = new SMTFacadeFactory(base.DataProvider).CreateSolderPasteFacade();
            }
            if (obj == null)
            {
                this.txtSPIDEdit.Text    = string.Empty;
                this.txtPartNOEdit.Text  = string.Empty;
                this.txtLotNOEdit.Text   = string.Empty;
                this.txtProDateEdit.Text = FormatHelper.ToDateString(FormatHelper.TODateInt(DateTime.Now));

                return;
            }

            SolderPaste solderPaste = obj as SolderPaste;

            this.txtSPIDEdit.Text    = solderPaste.SolderPasteID.ToString();
            this.txtPartNOEdit.Text  = solderPaste.PartNO.ToString();
            this.txtLotNOEdit.Text   = solderPaste.LotNO.ToString();
            this.txtProDateEdit.Text = FormatHelper.ToDateString(solderPaste.ProductionDate);
        }
Exemple #13
0
        private object[] GetEditObject()
        {
            if (this.ValidateInput())
            {
                if (_solderPasteFacade == null)
                {
                    _solderPasteFacade = new SMTFacadeFactory(base.DataProvider).CreateSolderPasteFacade();
                }

                string[] items = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtItemEdit.Text, int.MaxValue)).Split(',');

                if (items != null && items.Length > 0)
                {
                    ItemFacade itemFacade = new SMTFacadeFactory(base.DataProvider).CreateItemFacade();
                    object[]   spis       = new object[items.Length];

                    for (int i = 0; i < items.Length; i++)
                    {
                        SolderPaste2Item obj = this._solderPasteFacade.CreateNewSolderPaste2Item();

                        obj.ItemCode = items[i];
                        object item = itemFacade.GetItem(obj.ItemCode, GlobalVariables.CurrentOrganizations.First().OrganizationID);
                        if (item == null)
                        {
                            ExceptionManager.Raise(this.GetType(), string.Format("$Domain_ItemCode=[{0}], $Error_Not_Maintain", obj.ItemCode));
                            return(null);
                        }

                        object sp2Item = _solderPasteFacade.GetSolderPaste2Item(obj.ItemCode);
                        if (sp2Item != null)
                        {
                            ExceptionManager.Raise(this.GetType(), string.Format("$Domain_ItemCode=[{0}], $Error_SPType_Maintain${1}",
                                                                                 obj.ItemCode, (sp2Item as SolderPaste2Item).SolderPasteType));
                            return(null);
                        }

                        ///* 3.1	无铅锡膏可以用于产品代码编码中第二码是字母的所有产品 */
                        //if( string.Compare( drpSPTypeEdit.SelectedValue, SolderPasteType.Pb_Free, true )==0
                        //    && (!char.IsLetter( obj.ItemCode, 1 ))
                        //    && char.IsDigit( obj.ItemCode, 1 ) )
                        //{
                        //    ExceptionManager.Raise( this.GetType(), string.Format("$Domain_ItemCode=[{0}], $Error_SPType_Should_Maintain${1}",
                        //        obj.ItemCode, SolderPasteType.Pb ) );
                        //    return null;
                        //}
                        ///* 3.2	有铅锡膏可以用于产品代码编码中第二码是数字的所有产品 */
                        //else if( string.Compare( drpSPTypeEdit.SelectedValue, SolderPasteType.Pb, true )==0
                        //    && (!char.IsDigit( obj.ItemCode, 1 ))
                        //    && char.IsLetter( obj.ItemCode, 1 ))
                        //{
                        //    ExceptionManager.Raise( this.GetType(), string.Format("$Domain_ItemCode=[{0}], $Error_SPType_Should_Maintain${1}",
                        //        obj.ItemCode, SolderPasteType.Pb_Free ) );
                        //    return null;
                        //}

                        obj.SolderPasteType = drpSPTypeEdit.SelectedValue;
                        obj.MaintainUser    = this.GetUserCode();

                        spis[i] = obj;
                    }

                    return(spis);
                }

                return(null);
            }
            else
            {
                return(null);
            }
        }