public async static Task<PRO_tblLevel1DRO> InsertUpdateLevel1(PRO_tblLevel1DTO item, SYS_tblActionLogDTO actionLog) { PRO_tblLevel1DRO result = new PRO_tblLevel1DRO(); try { string url = string.Format(@"{0}/InsertUpdateLevel1", GetBaseUrl()); var postData = new PRO_tblLevel1DCO { Level1ID = item.Level1ID, Level1Code = item.Level1Code, Level1ShortCode = item.Level1ShortCode, VNName = item.VNName, ENName = item.ENName, Rank = string.IsNullOrEmpty(item.Rank) ? null : item.Rank, Note = item.Note, Description = item.Description, Used = item.Used, Activity = item.Activity, UserID = item.UserID, LanguageID = item.LanguageID }; var json_data = "{\"level1\":" + JsonConvert.SerializeObject(postData, new JsonSerializerSettings { DateFormatHandling = DateFormatHandling.MicrosoftDateFormat }) + "}"; result = await PRO_tblLevel1DAO.InsertUpdateLevel1(url, json_data); if (string.IsNullOrEmpty(result.ResponseItem.Message)) result.ResponseItem = await SYS_tblActionLogBUS.InsertUpdateLog(actionLog); } catch (Exception ex) { logger.Error(ex); result.ResponseItem.Message = ex.Message; } return result; }
public uc_Level1Detail(uc_Level1 _parent_form, PRO_tblLevel1DTO item = null) { CommonEngine.ShowWaitForm(this); InitializeComponent(); Initialize(); parent_form = _parent_form; if (item != null) LoadDataToEdit(item); CommonEngine.LoadUserPermission("20", txtLevel1ID, btnSaveClose, btnSaveInsert); }
private void LoadDataToEdit(PRO_tblLevel1DTO item) { txtLevel1ID.EditValue = (item == null) ? null : item.Level1ID; txtLevel1Code.EditValue = (item == null) ? null : item.Level1Code; //txtLevel1Code.Properties.ReadOnly = (item == null) ? false : true; txtLevel1ShortCode.Text = (item == null) ? null : item.Level1ShortCode; txtVNName.EditValue = (item == null) ? null : item.VNName; txtENName.EditValue = (item == null) ? null : item.ENName; speRank.EditValue = (item == null) ? null : item.Rank; chkUsed.Checked = (item == null) ? true : item.Used; mmoDescription.EditValue = (item == null) ? null : item.Description; mmoNote.EditValue = (item == null) ? null : item.Note; if (item == null) { depError.ClearErrors(); this.ParentForm.Text = LanguageEngine.GetOpenFormText(this.Name, ConfigEngine.Language, false); txtLevel1Code.Focus(); } }