protected override void UpdateDomainObject(object domainObject) { AlertSample sample = domainObject as AlertSample; if (sample != null) { _facade.UpdateAlertSample(sample); } }
protected override object GetEditObject(Infragistics.WebUI.UltraWebGrid.UltraGridRow row) { AlertSample sample = _facade.CreateNewAlertSample(); sample.ID = row.Cells[1].Value.ToString(); sample.SampleDesc = row.Cells[2].Value.ToString(); sample.MaintainUser = row.Cells[3].Value.ToString(); sample.MaintainDate = FormatHelper.TODateInt(row.Cells[4].Value.ToString()); return(sample); }
protected override string[] FormatExportRecord(object obj) { AlertSample sample = obj as AlertSample; if (sample != null) { return new string[] { sample.SampleDesc, sample.MaintainUser, FormatHelper.ToDateString(sample.MaintainDate) } } ; else { return(null); } }
protected override void SetEditObject(object obj) { if (obj == null) { this.txtOID.Text = String.Empty; this.txtSampleDescEdit.Text = string.Empty; return; } else { AlertSample sample = obj as AlertSample; if (sample != null) { this.txtOID.Text = sample.ID; this.txtSampleDescEdit.Text = sample.SampleDesc; } } }
protected override object GetEditObject() { if (this.ValidateInput()) { AlertSample sample = _facade.CreateNewAlertSample(); sample.ID = this.txtOID.Text.Trim() == string.Empty?Guid.NewGuid().ToString():this.txtOID.Text.Trim(); sample.SampleDesc = this.txtSampleDescEdit.Text; sample.MaintainDate = FormatHelper.TODateInt(DateTime.Now.ToShortDateString()); sample.MaintainTime = FormatHelper.TOTimeInt(DateTime.Now); sample.MaintainUser = this.GetUserCode(); return(sample); } else { return(null); } }
protected override Infragistics.WebUI.UltraWebGrid.UltraGridRow GetGridRow(object obj) { AlertSample sample = obj as AlertSample; if (obj != null) { return(new UltraGridRow(new object[] { "false", sample.ID, sample.SampleDesc, sample.MaintainUser, FormatHelper.ToDateString(sample.MaintainDate) } )); } else { return(null); } }