Esempio n. 1
0
 public async Task <bool> UpdateMaster(Model.Master data)
 {
     return(await new HttpRequest.Builder()
            .BaseURL(_url)
            .Uri($"/api/Master")
            .Method(HttpMethod.Put)
            .AddInterceptor(new JsonDeserializerInterceptor())
            .Content(new JsonContent(data))
            .Execute <bool>());
 }
Esempio n. 2
0
 public Task <bool> UpdateMaster(Model.Master data)
 {
     if (data.Type == Model.MasterType.EscalationCategory ||
         data.Type == Model.MasterType.ReinstateReason)
     {
         return(_apiClient.RequestMasterSdk.UpdateMaster(data));
     }
     else
     {
         return(_apiClient.JobOrderMasterSdk.UpdateMaster(data));
     }
 }
Esempio n. 3
0
        private void alButton1_Click(object sender, EventArgs e)
        {
            VipSoft.BLL.Master mBll = new BLL.Master();
            VipSoft.Model.Master mModel = new Model.Master();

            String account = this.f_account.Text.ToString();
            String password = this.f_password.Text.ToString();
            String name = this.f_name.Text.ToString();
            String shopid = this.f_shopid.Text.ToString();

            if (account == null || account == "")
            {
                MessageBox.Show("管理员代码不能为空!");
                return;
            }

            if (password == null || password == "")
            {
                MessageBox.Show("管理员密码不能为空!");
                return;
            }

            if (name == null || name == "")
            {
                MessageBox.Show("管理员名称不能为空!");
                return;
            }

            if (shopid == null || shopid == "")
            {
                MessageBox.Show("所属机构不能为空!");
                return;
            }

            mModel.Account = account;
            mModel.Password = password;
            mModel.Name = name;
            mModel.TelPhone = this.f_telphone.Text.ToString();
            mModel.Sex = int.Parse(((System.Collections.DictionaryEntry)f_sex.Items[0]).Value.ToString());
            mModel.IsSuper = f_issuper.Checked;
            mModel.ShopID = int.Parse(f_shopid.Text.ToString());
            mModel.ShopName = f_shopname.Text.ToString();

            if (this.currentId == 0)
            {
                if (mBll.Add(mModel) > 0)
                {
                    MessageBox.Show("新增记录成功!");
                    BindList();
                    reset();
                }
                else
                {
                    MessageBox.Show("新增记录失败!");
                }
            }
            else
            {
                mModel.ID = currentId;
                if (mBll.Update(mModel))
                {
                    MessageBox.Show("修改记录成功!");
                    BindList();
                    reset();

                }
                else
                {
                    MessageBox.Show("修改记录失败!");
                }

            }
        }