Beispiel #1
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                BLL.DataCenterBiz     biz = new BLL.DataCenterBiz();
                DTO.ConfigAssociation ent = new DTO.ConfigAssociation();
                ent.ASSOCIATION_CODE = txtAssociationCode.Text.Trim();
                ent.ASSOCIATION_NAME = txtAssociationName.Text.Trim();
                ent.AGENT_TYPE       = ddlAgentType.SelectedValue;
                ent.COMP_TYPE        = ddlCompType.SelectedValue;

                List <DTO.AssociationLicense> al = new List <DTO.AssociationLicense>();
                foreach (ListItem i in chkLicense.Items)
                {
                    al.Add(new DTO.AssociationLicense
                    {
                        ASSOCIATION_CODE  = txtAssociationCode.Text,
                        LICENSE_TYPE_CODE = i.Value,
                        ACTIVE            = i.Selected ? "Y" : "N"
                    });
                }

                var res = biz.UpdateAsscoiation(ent, UserProfile, al);
                if (!res.IsError)
                {
                    initGridAssociation();
                    UCSuccess.ShowMessageSuccess = SysMessage.SaveSucess;
                    UCSuccess.ShowModalSuccess();
                }
                else
                {
                    UCError.ShowMessageError = res.ErrorMsg;
                    UCError.ShowModalError();
                    mpeAssociation.Show();
                    UplPopUp.Update();
                }
            }
            catch (Exception ex)
            {
                UCError.ShowMessageError = ex.Message;
                UCError.ShowModalError();
                mpeAssociation.Show();
                UplPopUp.Update();
            }
        }