Exemplo n.º 1
0
        private void SaveFun()
        {
            try
            {
                using (SRUserRole.UserRoleServiceClient client = new SRUserRole.UserRoleServiceClient())
                {
                    SRUserRole.CommonResult resData = null;
                    var model = modelSource.DataSource as SRUserRole.UAD_Role;

                    if (model != null)
                    {
                        if (EidtStatus == 0)
                        {
                            resData = client.AddRole(model);
                        }
                        else
                        {
                            resData = client.EditRole(model);
                        }
                        if (resData.IsSuccess)
                        {
                            ClsMsg.ShowInfoMsg("保存成功!");
                        }
                        else
                        {
                            ClsMsg.ShowErrMsg(resData.Message);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ClsMsg.ShowErrMsg(ex.ToString());
            }
        }
Exemplo n.º 2
0
 private void frmRoleList_Load(object sender, EventArgs e)
 {
     try
     {
         using (SRUserRole.UserRoleServiceClient client = new SRUserRole.UserRoleServiceClient())
         {
             var resData = client.GetRoleList();
             gridControl1.DataSource = resData;
         }
     }
     catch (Exception ex)
     {
         ClsMsg.ShowErrMsg(ex.ToString());
     }
 }