protected override object GetEditObject() { if (_facade == null) { _facade = new ItemFacade(base.DataProvider); } if (this.ValidateInput()) { Item2SPCTable spc = this._facade.CreateNewItem2SPCTable(); spc.OID = this.txtOID.Text.Trim() != String.Empty?this.txtOID.Text:Guid.NewGuid().ToString(); spc.ItemCode = this._itemCode; spc.SPCTableName = this.txtTableNameEdit.Text; spc.StartDate = FormatHelper.TODateInt(this.dateStartDateEdit.Text); spc.EndDate = FormatHelper.TODateInt(this.dateEndDateEdit.Text); spc.Description = this.txtDescription.Text; spc.MaintainDate = FormatHelper.TODateInt(DateTime.Now); spc.MaintainTime = FormatHelper.TOTimeInt(DateTime.Now); spc.MaintainUser = this.GetUserCode(); return(spc); } else { return(null); } }
protected override void SetEditObject(object obj) { if (obj == null) { this.txtOID.Text = String.Empty; this.txtTableNameEdit.Text = String.Empty;; this.txtItemCodeEdit.Text = this._itemName; this.dateStartDateEdit.Text = DateTime.Now.ToShortDateString(); this.dateEndDateEdit.Text = "2999-12-31"; this.txtDescription.Text = String.Empty; return; } Item2SPCTable spc = obj as Item2SPCTable; if (spc == null) { return; } this.txtOID.Text = spc.OID; this.txtTableNameEdit.Text = spc.SPCTableName; this.txtItemCodeEdit.Text = this._itemName; this.dateStartDateEdit.Text = FormatHelper.ToDateString(spc.StartDate); this.dateEndDateEdit.Text = FormatHelper.ToDateString(spc.EndDate); this.txtDescription.Text = spc.Description; }
protected override Infragistics.WebUI.UltraWebGrid.UltraGridRow GetGridRow(object obj) { Item2SPCTable spc = obj as Item2SPCTable; if (spc != null) { return(new Infragistics.WebUI.UltraWebGrid.UltraGridRow( new object[] { "false", spc.OID, _itemName, spc.SPCTableName, FormatHelper.ToDateString(spc.StartDate), FormatHelper.ToDateString(spc.EndDate), spc.Description, spc.MaintainUser.ToString(), FormatHelper.ToDateString(spc.MaintainDate) })); } else { return(null); } }