示例#1
0
        public async static Task<PRO_tblLevel2DRO> InsertUpdateLevel2(PRO_tblLevel2DTO item, SYS_tblActionLogDTO actionLog)
        {
            PRO_tblLevel2DRO result = new PRO_tblLevel2DRO();
            try
            {
                string url = string.Format(@"{0}/InsertUpdateLevel2", GetBaseUrl());
                var postData = new PRO_tblLevel2DCO
                {
                    Level2ID = item.Level2ID,
                    Level2Code = item.Level2Code,
                    Level2ShortCode = item.Level2ShortCode,
                    Level1ID = item.Level1ID,
                    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 = "{\"level2\":" + JsonConvert.SerializeObject(postData, new JsonSerializerSettings
                {
                    DateFormatHandling = DateFormatHandling.MicrosoftDateFormat
                }) + "}";

                result = await PRO_tblLevel2DAO.InsertUpdateLevel2(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;
        }
示例#2
0
        public uc_Level2Detail(uc_Level2 _parent_form, PRO_tblLevel2DTO item = null)
        {
            CommonEngine.ShowWaitForm(this);
            InitializeComponent();
            Initialize();
            parent_form = _parent_form;

            if (item != null)
                LoadDataToEdit(item);
            CommonEngine.LoadUserPermission("21", txtLevel2ID, btnSaveClose, btnSaveInsert);
        }
示例#3
0
 private void LoadDataToEdit(PRO_tblLevel2DTO item)
 {
     txtLevel2ID.EditValue = item == null ? null : item.Level2ID;
     txtLevel2Code.EditValue = item == null ? null : item.Level2Code;
     txtLevel2ShortCode.EditValue = item == null ? null : item.Level2ShortCode;
     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;
     gluLevel1.EditValue = item == null ? null : item.Level1ID;
     if (item == null)
     {
         depError.ClearErrors();
         this.ParentForm.Text = LanguageEngine.GetOpenFormText(this.Name, ConfigEngine.Language, false);
         txtLevel2Code.Focus();
     }
 }