示例#1
0
        public void EditPersonal(DTO.MemberType memberType, DTO.PersonTemp personal)
        {
            var    biz = new BLL.PersonBiz();
            String res = ucAttachFileControl1.ValidDocRequire();

            if (String.IsNullOrEmpty(res))
            {
                var final = biz.SetPersonTemp(personal, ucAttachFileControl1.AttachFiles.Where(p => p.FILE_STATUS != "A").ConvertToPersonAttatchFiles().ToArray());
                if ((final.IsError) || (final.ResultMessage == false))
                {
                    UCModalError.ShowMessageError = final.ErrorMsg;
                    UCModalError.ShowModalError();
                }
                else if (final.ResultMessage == true)
                {
                    UCModalSuccess.ShowMessageSuccess = SysMessage.SaveSucess;
                    UCModalSuccess.ShowModalSuccess();
                    btnClose.Visible  = true;
                    btnCancel.Visible = false;
                    btnOk.Visible     = false;
                    //Response.Redirect("~/BankPage.aspx");
                }
            }
            else
            {
                ModelError.ShowMessageError = res;
                ModelError.ShowModalError();
            }
        }
示例#2
0
        public void EditCompany(DTO.MemberType memberType, DTO.PersonTemp personal)
        {
            //var biz = new BLL.PersonBiz();
            //DTO.ResponseMessage<bool> res =  ucAttachFileControl1.DocRequire();
            //if (res.ResultMessage == true)
            //{
            //    var final = biz.SetPersonTemp(personal, ucAttachFileControl1.AttachFiles.Where(p => p.FILE_STATUS != "A").ConvertToPersonAttatchFiles().ToArray());

            //    if (final.IsError)
            //    {
            //        UCModalError.ShowMessageError = final.ErrorMsg;
            //        UCModalError.ShowModalError();

            //    }
            //}
            //else if ((res.ResultMessage == false) || (res.IsError))
            //{
            //    ModelError.ShowMessageError = SysMessage.FileRequire + res.ErrorMsg;
            //    ModelError.ShowModalError();
            //}
            var    biz = new BLL.PersonBiz();
            String res = ucAttachFileControl1.ValidDocRequire();

            if (String.IsNullOrEmpty(res))
            {
                var final = biz.SetPersonTemp(personal, ucAttachFileControl1.AttachFiles.Where(p => p.FILE_STATUS != "A").ConvertToPersonAttatchFiles().ToArray());
                if ((final.IsError) || (final.ResultMessage == false))
                {
                    UCModalError.ShowMessageError = final.ErrorMsg;
                    UCModalError.ShowModalError();
                }
                else if (final.ResultMessage == true)
                {
                    UCModalSuccess.ShowMessageSuccess = SysMessage.SaveSucess;
                    UCModalSuccess.ShowModalSuccess();
                    btnClose.Visible  = true;
                    btnCancel.Visible = false;
                    btnOk.Visible     = false;
                }
            }
            else
            {
                ModelError.ShowMessageError = res;
                ModelError.ShowModalError();
            }
        }
示例#3
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (id == 0)
     {
         if (txtTitle.Text == "")
         {
             MessageBox.Show("សូមបំពេញពត៏មានឲ្យបានត្រឹមត្រូវ!!!");
         }
         else
         {
             DTO.MemberType memberType = new MemberType(txtTitle.Text);
           
             if (new MemberTypeDAO().AddMemberType(memberType))
             {
                 txtTitle.Clear();
                 dgvMemberType.DataSource = new DAO.MemberTypeDAO().GetAllMemberTypes().Tables[0];
                 id = 0;
             }
             else
             {
                 MessageBox.Show("ប្រតិបត្តិការណ៍បរាជ័យ!!!");
             }
         }
     }
     else
     {
         DTO.MemberType memebrType = new DTO.MemberType(id, txtTitle.Text);
         if (new MemberTypeDAO().UdateMemberType(memebrType))
         {
             txtTitle.Clear();
             dgvMemberType.DataSource = new DAO.MemberTypeDAO().GetAllMemberTypes().Tables[0];
             id = 0;
             btnDelete.Visible = false;
         }
         else
         {
             MessageBox.Show("ប្រតិបត្តិការណ៍បរាជ័យ!!!");
         }
     }
 }
示例#4
0
        public static IEnumerable <DTO.DataItem> GetLicenseTypeItem(IIASPersonEntities ctx, DTO.MemberType memberType, String compcode)
        {
            //DTO.MemberType memberType = (DTO.MemberType)userProfile.MemberType;
            //String compcode = userProfile.CompCode;

            switch (memberType)
            {
            case IAS.DTO.MemberType.General:
            case IAS.DTO.MemberType.OIC:
            case IAS.DTO.MemberType.OICAgent:
                return(ctx.AG_IAS_LICENSE_TYPE_R.Where(w => w.ACTIVE_FLAG == "Y").OrderBy(x => x.LICENSE_TYPE_CODE)
                       .Select(s => new DTO.DataItem
                {
                    Id = s.LICENSE_TYPE_CODE,
                    Name = s.LICENSE_TYPE_NAME
                }).ToList());


            case IAS.DTO.MemberType.Insurance:
                if (String.IsNullOrWhiteSpace(compcode))
                {
                    throw new ApplicationException("ไม่พบรหัสบริษัทประกันภัย");
                }

                VW_AS_COMPANY_T company = ctx.VW_AS_COMPANY_T.SingleOrDefault(c => c.COMP_CODE == compcode);
                if (company == null)
                {
                    throw new ApplicationException("ไม่พบรหัสบริษัทประกันภัย");
                }


                if (compcode.StartsWith("1"))
                {
                    return(ctx.AG_IAS_LICENSE_TYPE_R.Where(w => w.LICENSE_TYPE_CODE == "01" ||
                                                           w.LICENSE_TYPE_CODE == "07").OrderBy(x => x.LICENSE_TYPE_CODE)
                           .Select(s => new DTO.DataItem
                    {
                        Id = s.LICENSE_TYPE_CODE,
                        Name = s.LICENSE_TYPE_NAME
                    }).ToList());
                }
                else if (compcode.StartsWith("2"))
                {
                    return(ctx.AG_IAS_LICENSE_TYPE_R.Where(w => w.LICENSE_TYPE_CODE == "02" ||
                                                           w.LICENSE_TYPE_CODE == "05" ||
                                                           w.LICENSE_TYPE_CODE == "06" ||
                                                           w.LICENSE_TYPE_CODE == "08").OrderBy(x => x.LICENSE_TYPE_CODE)
                           .Select(s => new DTO.DataItem
                    {
                        Id = s.LICENSE_TYPE_CODE,
                        Name = s.LICENSE_TYPE_NAME
                    }).ToList());
                }
                else if (compcode.StartsWith("3"))
                {
                    return(ctx.AG_IAS_LICENSE_TYPE_R.Where(w => w.LICENSE_TYPE_CODE == "03" ||
                                                           w.LICENSE_TYPE_CODE == "04" ||
                                                           w.LICENSE_TYPE_CODE == "11" ||
                                                           w.LICENSE_TYPE_CODE == "12").OrderBy(x => x.LICENSE_TYPE_CODE)
                           .Select(s => new DTO.DataItem
                    {
                        Id = s.LICENSE_TYPE_CODE,
                        Name = s.LICENSE_TYPE_NAME
                    }).ToList());
                }
                else
                {
                    return(new List <DTO.DataItem>());
                }



            case IAS.DTO.MemberType.Association:
            case IAS.DTO.MemberType.TestCenter:

                if (String.IsNullOrWhiteSpace(compcode))
                {
                    throw new ApplicationException("ไม่พบรหัสสมาคม");
                }
                AG_IAS_ASSOCIATION assocition = ctx.AG_IAS_ASSOCIATION.SingleOrDefault(a => a.ASSOCIATION_CODE == compcode);
                if (assocition == null)
                {
                    throw new ApplicationException("ไม่พบรหัสสมาคม");
                }

                return(ctx.AG_IAS_ASSOCIATION_LICENSE.Join(ctx.AG_IAS_LICENSE_TYPE_R,
                                                           s => s.LICENSE_TYPE_CODE,
                                                           c => c.LICENSE_TYPE_CODE,
                                                           (s, c) => new { s, c })
                       .Where(sc => sc.s.ASSOCIATION_CODE == compcode && sc.s.ACTIVE == "Y")
                       .Select(sc => new DTO.DataItem
                {
                    Id = sc.s.LICENSE_TYPE_CODE,
                    Name = sc.c.LICENSE_TYPE_NAME
                }).ToList());

            case IAS.DTO.MemberType.OICFinance:
                return(new List <DTO.DataItem>());


            default:
                return(new List <DTO.DataItem>());
            }
        }