Exemple #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;
                ent.ASSOCIATION_NAME = txtAssociationName.Text;
                ent.UPDATED_BY       = base.UserId.ToString();
                ent.UPDATED_DATE     = DateTime.Now;
                ent.ACTIVE           = "Y";

                List <DTO.AssociationLicense> al = new List <DTO.AssociationLicense>();
                var res = biz.InsertExamPlaceGroupR(ent, UserProfile, al);
                if (!res.IsError)
                {
                    initGridAssociation();
                    UCSuccess.ShowMessageSuccess = SysMessage.SaveSucess;
                    UCSuccess.ShowModalSuccess();
                }
                else
                {
                    UCError.ShowMessageError = res.ErrorMsg;
                    UCError.ShowModalError();
                }
            }
            catch (Exception ex)
            {
                UCError.ShowMessageError = ex.Message;
                UCError.ShowModalError();
            }
        }
Exemple #2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (!string.IsNullOrEmpty(txtAssociationCode.Text) && !string.IsNullOrEmpty(txtAssociationName.Text))
                {
                    if (txtAssociationCode.Text.Length == 3)
                    {
                        BLL.DataCenterBiz biz = new BLL.DataCenterBiz();
                        var checkid           = biz.GetExamPlaceGroupRByCheckID(txtAssociationCode.Text, txtAssociationName.Text);

                        List <DTO.AssociationLicense> al  = new List <DTO.AssociationLicense>();
                        DTO.ConfigAssociation         ent = new DTO.ConfigAssociation();
                        ent.ASSOCIATION_CODE = txtAssociationCode.Text;
                        ent.ASSOCIATION_NAME = txtAssociationName.Text;
                        ent.ACTIVE           = "Y";

                        var res = biz.InsertExamPlaceGroupR(ent, UserProfile, al);
                        if (!res.IsError)
                        {
                            initGridAssociation();
                            UCSuccess.ShowMessageSuccess = SysMessage.SaveSucess;
                            UCSuccess.ShowModalSuccess();
                        }
                        else
                        {
                            UCError.ShowMessageError = res.ErrorMsg;
                            UCError.ShowModalError();
                        }
                    }
                    else
                    {
                        UCError.ShowMessageError = "รหัสหน่วยงานจัดสอบต้องมีจำนวน 3 ตัวอักษรเท่านั้น";
                        UCError.ShowModalError();
                    }
                }
                else
                {
                    UCError.ShowMessageError = "กรุณากรอกข้อมูลสมาคมให้ครบถ้วน";
                    UCError.ShowModalError();
                }
            }
            catch (Exception ex)
            {
                UCError.ShowMessageError = ex.Message;
                UCError.ShowModalError();
            }
            txtAssociationCode.Text = "";
            txtAssociationName.Text = "";
        }
Exemple #3
0
        protected void functionDelete(string ID)
        {
            BLL.DataCenterBiz             biz = new BLL.DataCenterBiz();
            DTO.ConfigAssociation         ent = new DTO.ConfigAssociation();
            List <DTO.AssociationLicense> al  = new List <DTO.AssociationLicense>();

            ent.ASSOCIATION_CODE = ID;
            ent.ACTIVE           = "N";
            var res = biz.InsertExamPlaceGroupR(ent, UserProfile, al);

            //var res = biz.DeleteAsscoiation(ID);
            if (!res.IsError)
            {
                initGridAssociation();
                UCSuccess.ShowMessageSuccess = SysMessage.DeleteSuccess;
                UCSuccess.ShowModalSuccess();
            }
            else
            {
                UCError.ShowMessageError = res.ErrorMsg;
                UCError.ShowModalError();
            }
        }