Ejemplo n.º 1
0
        private void GetAssociationDefult()
        {
            try
            {
                string        AssC = "";
                DataCenterBiz biz  = new DataCenterBiz();
                if (base.UserRegType.GetEnumValue() == DTO.RegistrationType.Association.GetEnumValue())
                {
                    AssC = base.UserProfile.CompCode;
                }

                var ls = biz.GetAssociation(AssC);
                // var ls = biz.GetAssociationJoinLicense(AssC, ddlLicenseType.SelectedValue.ToString());
                ddlAsso.DataValueField = "ASSOCIATION_CODE";
                ddlAsso.DataTextField  = "ASSOCIATION_NAME";

                ddlAsso.DataSource = ls.DataResponse;
                ddlAsso.DataBind();

                ddlAsso.Items.Insert(0, SysMessage.DefaultSelecting);

                ddlAsso.SelectedValue = AssC;
                ddlAsso.Enabled       = false;
            }
            catch
            {
            }
        }
Ejemplo n.º 2
0
        private void GetAssociation()
        {
            try
            {
                if (ddlLicenseType.SelectedIndex > 0)
                {
                    string        AssC = "";
                    DataCenterBiz biz  = new DataCenterBiz();
                    if (base.UserRegType.GetEnumValue() == DTO.RegistrationType.Association.GetEnumValue())
                    {
                        AssC = base.UserProfile.CompCode;
                    }


                    var ls = biz.GetAssociationJoinLicense(AssC, ddlLicenseType.SelectedValue.ToString());
                    ddlAsso.DataValueField = "ASSOCIATION_CODE";
                    ddlAsso.DataTextField  = "ASSOCIATION_NAME";

                    ddlAsso.DataSource = ls.DataResponse;
                    ddlAsso.DataBind();

                    ddlAsso.Items.Insert(0, SysMessage.DefaultSelecting);
                }
                else
                {
                    UCModalError.ShowMessageError = "กรุณาเลือกประเภทใบอนุญาตที่สอบ";
                    UCModalError.ShowModalError();
                }
            }
            catch
            {
            }
        }
Ejemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         DataCenterBiz biz  = new DataCenterBiz();
         var           Auto = biz.GetConficValueByTypeAndGroupCode("09", "AP001");
         if (Auto.DataResponse == "0")
         {
             Manage_App = new List <string>();
             base.HasPermit();
             defaultData();
             PnlSearch.Visible = true;
         }
         else
         {
             base.HasPermit();
             UCModalError.ShowMessageError = "การจัดผู้สมัครสอบเข้าสู่ห้องสอบเป็นการจัดการแบบ<u>อัตโนมัติ</u><br/>ผู้ใช้งานไม่สามารถดำเนินการได้ หากมีปัญหากรุณาติดต่อเจ้าหน้าที่ดูแลระบบ";
             UCModalError.ShowModalError();
             PnlSearch.Visible = false;
         }
         //GetPlaceGroup();
         //gv3.Visible = false;
         //gv2.Visible = false;
     }
 }
Ejemplo n.º 4
0
        protected List <DTO.DataItem> GetMemberTypeFor(string MemberType)
        {
            DataCenterBiz       biz  = new DataCenterBiz();
            List <DTO.DataItem> item = new List <DTO.DataItem>();
            List <DTO.DataItem> res  = biz.GetMemberType("", false);

            switch (MemberType)
            {
            case "1":
                item = res.Where(x => x.Id == "1").ToList();
                break;

            case "2":
            case "3":
            case "7":
                item = res.Where(x => x.Id == "2" || x.Id == "3" || x.Id == "7").ToList();
                break;

            case "4":
            /*item = res.Where(x => x.Id == "4").ToList();
             * break;*/
            case "5":
            case "6":
                item = res.Where(x => x.Id == "5" || x.Id == "6" || x.Id == "4").ToList();
                break;

            default:
                item = res;
                break;
            }
            return(item);
        }
Ejemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DataCenterBiz biz = new DataCenterBiz();

            txtStartPaidSubDate.Attributes.Add("readonly", "true");
            txtEndPaidSubDate.Attributes.Add("readonly", "true");
            txtTestingDate.Attributes.Add("readonly", "true");
            if (!Page.IsPostBack)
            {
                ListAppNoPay = new List <DTO.AppNoPay>();
                // PageSize = PAGE_SIZE_Key;
                base.HasPermit();
                PnlDetail.Visible      = true;
                btnDelete.Visible      = false;
                txtNumberGvSearch.Text = "0";
                txt_Page_now.Text      = "0";
                txtTotalPage.Text      = "0";
                lbltotalP.Text         = "0";
                rowPerpage.Text        = Convert.ToString(PageSize);
                txt_input.Text         = Convert.ToString(PageSize);
                //BindDataInGridview();
                OBJ_page1(false);
                OBJ_page2(false);
                PnlSearch.Visible = true;
                getConfigDate();

                Set_textDate(0);
            }
        }
Ejemplo n.º 6
0
        private void GetExamGRoup()
        {
            try
            {
                string        ComP = "";
                DataCenterBiz biz  = new DataCenterBiz();
                if (base.UserProfile.MemberType != DTO.RegistrationType.OIC.GetEnumValue())
                {
                    ComP = base.UserProfile.CompCode;
                }

                var ls = biz.GetExamPlaceGroupByCompCode(SysMessage.DefaultSelecting, ComP);
                ddlPlaceG.DataValueField = "Id";
                ddlPlaceG.DataTextField  = "Name";

                ddlPlaceG.DataSource = ls.DataResponse;
                ddlPlaceG.DataBind();

                ddlPlaceG.Items.Insert(0, SysMessage.DefaultSelecting);
                if (ComP != "")
                {
                    ddlPlaceG.SelectedValue = ComP;
                    ddlPlaceG.Enabled       = false;
                }
            }
            catch
            {
            }
        }
Ejemplo n.º 7
0
        private void GetDocReqName()
        {
            DTO.ResponseMessage <bool> res = new DTO.ResponseMessage <bool>();
            DataCenterBiz biz = new DataCenterBiz();

            IAS.DTO.ResponseService <IAS.DTO.ConfigDocument[]> getDoc = biz.GetDocRequire(Convert.ToString(DTO.DocFunction.LICENSE_FUNCTION.GetEnumValue()),
                                                                                          Convert.ToString(this.MasterLicense.UserProfile.MemberType), this.MasterLicense.LicenseTypeCode, this.MasterLicense.PettionTypeCode);

            //Add Doc Req to lblDocReq
            if ((getDoc.DataResponse.Count() > 0) && (getDoc.DataResponse != null))
            {
                StringBuilder docName = new StringBuilder();
                if (getDoc.DataResponse.Count() == 1)
                {
                    docName.Append(getDoc.DataResponse[0].DOCUMENT_NAME + "&nbsp;" + "" + Environment.NewLine + "");
                }
                else
                {
                    for (int i = 0; i < getDoc.DataResponse.Count(); i++)
                    {
                        docName.Append((i + 1).ToString() + "." + getDoc.DataResponse[i].DOCUMENT_NAME + Environment.NewLine);
                    }
                }

                lblNote1.Visible = true;
                lblDocReq.Text   = docName.ToString();
            }
            //กรณีไม่ต้องแนบเอกสาร 25/11/2556
            else
            {
                lblNote1.Visible = false;
            }
        }
Ejemplo n.º 8
0
        private void GetAssociation()
        {
            try
            {
                string        AssC = "";
                DataCenterBiz biz  = new DataCenterBiz();
                if (base.UserProfile.MemberType != DTO.RegistrationType.OIC.GetEnumValue())
                {
                    AssC = base.UserProfile.CompCode;
                }

                var ls = biz.GetAssociation(AssC);
                ddlPlaceG.DataValueField = "ASSOCIATION_CODE";
                ddlPlaceG.DataTextField  = "ASSOCIATION_NAME";

                ddlPlaceG.DataSource = ls.DataResponse;
                ddlPlaceG.DataBind();

                ddlPlaceG.Items.Insert(0, SysMessage.DefaultSelecting);
                if (AssC != "")
                {
                    ddlPlaceG.SelectedValue = AssC;
                    ddlPlaceG.Enabled       = false;
                }
            }
            catch
            {
            }
        }
Ejemplo n.º 9
0
        private Boolean FilterContentTypeImage(String contentType)
        {
            String typeXls = Utils.ContentTypeHelper.MimeType(".xls");

            DataCenterBiz biz = new DataCenterBiz();
            var           res = biz.GetDocumentTypeAll("");

            switch (contentType)
            {
            case "image/bmp": return(true);

            case "image/gif": return(true);

            case "image/jpeg": return(true);

            case "image/png": return(true);

            case "image/x-png": return(true);

            case "image/pjpeg": return(true);

            case "image/tiff": return(true);

            default:
                return(false);
            }
        }
Ejemplo n.º 10
0
        protected void SetMemberType()
        {
            DataCenterBiz biz = new DataCenterBiz();
            var           ls  = biz.GetMemberType("ทั้งหมด", false);

            ls[1].Name = NameMemberType1;
            BindToDDL(ddlUserType, ls.ToArray());
        }
Ejemplo n.º 11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         DataCenterBiz bizCenter = new DataCenterBiz();
         ddlType.DataSource = bizCenter.GetLicenseType("--เลือกประเภทใบอนุญาต--").DataResponse;
         ddlType.DataBind();
     }
 }
Ejemplo n.º 12
0
        public void ProcessRequest(HttpContext context)
        {
            string searchText = context.Request.QueryString["term"];
            JavaScriptSerializer serializer = new JavaScriptSerializer();

            DataCenterBiz biz        = new DataCenterBiz();
            var           res        = biz.GetCompanyCodeByName(searchText);
            string        jsonString = serializer.Serialize(res);

            context.Response.Write(jsonString);
        }
Ejemplo n.º 13
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         DataCenterBiz bizCenter = new DataCenterBiz();
         ddlType.DataSource = bizCenter.GetLicenseType("--เลือกประเภทใบอนุญาต--").DataResponse;
         ddlType.DataBind();
         var res = biz.GetSubjectGroupSearch("", txtPage.Text.ToInt(), txtCountRecord.Text.ToInt());
         gvSearch.DataSource = res.DataResponse;
         gvSearch.DataBind();
         lblCountRecord.Text = res.CountRecord.ToString();
         lblCountPage.Text   = res.CountPage.ToString();
     }
 }
Ejemplo n.º 14
0
 private void GetProvince()
 {
     try
     {
         DataCenterBiz biz = new DataCenterBiz();
         var           ls  = biz.GetProvince(SysMessage.DefaultSelecting);
         ddlProvince.DataValueField = "Id";
         ddlProvince.DataTextField  = "Name";
         ddlProvince.DataSource     = ls;
         ddlProvince.DataBind();
     }
     catch
     {
     }
 }
Ejemplo n.º 15
0
        protected void btnSubmitExtraApproveRegis_Click(object sender, EventArgs e)
        {
            DataCenterBiz biz = new DataCenterBiz();
            //int chkCount = 0;
            List <CheckBox> chkls             = new List <CheckBox>();
            List <DTO.ConfigExtraEntity> data = new List <DTO.ConfigExtraEntity>();


            foreach (CheckBox chk in pnlProfile.Controls.OfType <CheckBox>())
            {
                if (chk.Checked == true)
                {
                    data.Add(new DTO.ConfigExtraEntity
                    {
                        Name  = chk.Text,
                        Value = 1
                    });
                }
                else
                {
                    data.Add(new DTO.ConfigExtraEntity
                    {
                        Name  = chk.Text,
                        Value = 0
                    });
                }
            }

            if (data != null)
            {
                DTO.ResponseMessage <bool> res = biz.UpdateNewConfigApproveMember(data.ToArray(), base.UserProfile);
                if (res.IsError)
                {
                    UCModalError.ShowMessageError = res.ErrorMsg;
                    UCModalError.ShowModalError();
                }
                else
                {
                    UCModalSuccess.ShowMessageSuccess = "บันทึกข้อมูลเรียบร้อย";
                    UCModalSuccess.ShowModalSuccess();

                    this.GetNewRegistrationApprove();
                    UpdatePanelGrid.Update();
                }
            }
        }
Ejemplo n.º 16
0
        private void GetNewRegistrationApprove()
        {
            DataCenterBiz   biz      = new DataCenterBiz();
            int             chkCount = 0;
            List <CheckBox> chkls    = new List <CheckBox>();

            DTO.ResponseService <DTO.ConfigExtraEntity[]> resnewCfg = biz.GetNewConfigApproveMember();
            if (resnewCfg.DataResponse != null)
            {
                if (resnewCfg.DataResponse.Count() > 0)
                {
                    //int chkCounts = pnlProfile.Controls.OfType<CheckBox>().Count();
                    foreach (CheckBox chk in pnlProfile.Controls.OfType <CheckBox>())
                    {
                        chkls.Add(chk);
                        chkCount++;
                    }

                    if (resnewCfg.DataResponse.Count() == chkCount)
                    {
                        for (int i = 0; i < resnewCfg.DataResponse.Count(); i++)
                        {
                            CheckBox chkIdx = chkls.Where(x => x.Text == resnewCfg.DataResponse[i].Name).FirstOrDefault();
                            if (chkIdx != null)
                            {
                                if (resnewCfg.DataResponse[i].Value.Equals(1))
                                {
                                    chkIdx.Checked = true;
                                }
                                else
                                {
                                    chkIdx.Checked = false;
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                UCModalError.ShowMessageError = resnewCfg.ErrorMsg;
                UCModalError.ShowModalError();
            }
        }
Ejemplo n.º 17
0
        protected void gvGeneral_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int   index             = e.Row.RowIndex;
                Label lblId             = (Label)e.Row.Cells[0].FindControl("lblIdGvGeneral");
                Label lblValueGvGeneral = (Label)e.Row.Cells[0].FindControl("lblValueGvGeneral");

                CheckBox chkSpecifiedValueGeneral = (CheckBox)e.Row.Cells[0].FindControl("chkSpecifiedValueGeneral");

                TextBox      txtYearValue  = (TextBox)e.Row.Cells[0].FindControl("txtYearValue");
                DropDownList ddlPicLicense = (DropDownList)e.Row.Cells[0].FindControl("ddlConfigPicForLicense");

                if (lblId.Text == "13")
                {
                    DataCenterBiz dcbiz = new DataCenterBiz();
                    BindToDDL(ddlPicLicense, dcbiz.GetDocumentTypeIsImage());
                    ddlPicLicense.Visible            = true;
                    ddlPicLicense.SelectedValue      = lblValueGvGeneral.Text;
                    chkSpecifiedValueGeneral.Checked = false;
                    chkSpecifiedValueGeneral.Visible = false;
                    txtYearValue.Visible             = false;
                }
                else if (lblValueGvGeneral.Text == "N")
                {
                    chkSpecifiedValueGeneral.Checked = false;
                    txtYearValue.Visible             = false;
                    ddlPicLicense.Visible            = false;
                }
                else if (lblValueGvGeneral.Text == "Y")
                {
                    chkSpecifiedValueGeneral.Checked = true;
                    txtYearValue.Visible             = false;
                    ddlPicLicense.Visible            = false;
                }
                else if (lblValueGvGeneral.Text != "Y" && lblValueGvGeneral.Text != "N")
                {
                    txtYearValue.Text = lblValueGvGeneral.Text;
                    chkSpecifiedValueGeneral.Visible = false;
                    txtYearValue.Visible             = true;
                    ddlPicLicense.Visible            = false;
                }
            }
        }
Ejemplo n.º 18
0
        protected void btnOkCfgCheckExamLicense_Click(object sender, EventArgs e)
        {
            try
            {
                DataCenterBiz           Dcbiz = new DataCenterBiz();
                List <DTO.ConfigEntity> ent   = new List <DTO.ConfigEntity>();
                foreach (GridViewRow row in gvCfgCheckExamLicense.Rows)
                {
                    Label    ID  = row.FindControl("lblIdCfgCheckExamLicense") as Label;
                    CheckBox chk = row.FindControl("chkItemValueCfgCheckExamLicense") as CheckBox;

                    ent.Add(new DTO.ConfigEntity
                    {
                        Id         = ID.Text,
                        Item_Value = (chk.Checked ? "1" : "0")
                    });
                }

                var res = Dcbiz.UpdateConfigCheckExamLicense(ent, UserProfile);
                if (res.IsError)
                {
                    UCModalError.ShowMessageError = res.ErrorMsg;
                    UCModalError.ShowModalError();
                }
                else
                {
                    UCModalSuccess.ShowMessageSuccess = "บันทึกข้อมูลเรียบร้อย";
                    UCModalSuccess.ShowModalSuccess();
                    GridViewDataBindSingleMode("5");
                    UpdatePanelGrid.Update();
                }
            }
            catch (Exception ex)
            {
                UCModalError.ShowMessageError = ex.Message;
                UCModalError.ShowModalError();
            }
        }
Ejemplo n.º 19
0
        private void GetAddressByCriteria(string Mode, string pvID, string disctID, string tumbID)
        {
            DataCenterBiz  biz     = new DataCenterBiz();
            List <TextBox> txtList = new List <TextBox>();

            //AG_PERSONAL_T
            if (Mode.Equals(DTO.ApproveAddressMode.Personal_local.GetEnumValue().ToString()))
            {
                if (pvID.Equals("") || disctID.Equals("") || tumbID.Equals(""))
                {
                    txtProvinceCurrentAddressBeforeReg.Text = "-";
                    txtDistrictCurrentAddressBeforeReg.Text = "-";
                    txtParishCurrentAddressBeforeReg.Text   = "-";
                }
                else
                {
                    var lsPV  = biz.GetProvinceById(pvID);
                    var lsAum = biz.GetAmpurById(pvID, disctID);
                    var lsTum = biz.GetTumbonById(pvID, disctID, tumbID);

                    txtList.Add(txtProvinceCurrentAddressBeforeReg);
                    txtList.Add(txtDistrictCurrentAddressBeforeReg);
                    txtList.Add(txtParishCurrentAddressBeforeReg);
                    string[] addressList = { lsPV.DataResponse.Name, lsAum.DataResponse.Name, lsTum.DataResponse.Name };
                    this.SetAddresstoControl(txtList, addressList);
                }
            }
            else if (Mode.Equals(DTO.ApproveAddressMode.Personal_regis.GetEnumValue().ToString()))
            {
                if (pvID.Equals("") || disctID.Equals("") || tumbID.Equals(""))
                {
                    txtProvinceRegisterAddressBeforeReg.Text = "-";
                    txtDistrictRegisterAddressBeforeReg.Text = "-";
                    txtParishRegisterAddressBeforeReg.Text   = "-";
                }
                else
                {
                    var lsPV  = biz.GetProvinceById(pvID);
                    var lsAum = biz.GetAmpurById(pvID, disctID);
                    var lsTum = biz.GetTumbonById(pvID, disctID, tumbID);

                    txtList.Add(txtProvinceRegisterAddressBeforeReg);
                    txtList.Add(txtDistrictRegisterAddressBeforeReg);
                    txtList.Add(txtParishRegisterAddressBeforeReg);
                    string[] addressList = { lsPV.DataResponse.Name, lsAum.DataResponse.Name, lsTum.DataResponse.Name };
                    this.SetAddresstoControl(txtList, addressList);
                }
            }
            //AG_IAS_REGISTRATION_T
            else if (Mode.Equals(DTO.ApproveAddressMode.Registration_local.GetEnumValue().ToString()))
            {
                if (pvID.Equals("") || disctID.Equals("") || tumbID.Equals(""))
                {
                    txtProvinceRegisterAddressAfterReg.Text = "-";
                    txtDistrictRegisterAddressAfterReg.Text = "-";
                    txtParishRegisterAddressAfterReg.Text   = "-";
                }
                else
                {
                    var lsPV  = biz.GetProvinceById(pvID);
                    var lsAum = biz.GetAmpurById(pvID, disctID);
                    var lsTum = biz.GetTumbonById(pvID, disctID, tumbID);

                    txtList.Add(txtProvinceRegisterAddressAfterReg);
                    txtList.Add(txtDistrictRegisterAddressAfterReg);
                    txtList.Add(txtParishRegisterAddressAfterReg);
                    string[] addressList = { lsPV.DataResponse.Name, lsAum.DataResponse.Name, lsTum.DataResponse.Name };
                    this.SetAddresstoControl(txtList, addressList);
                }
            }
            else if (Mode.Equals(DTO.ApproveAddressMode.Registration_regis.GetEnumValue().ToString()))
            {
                if (pvID.Equals("") || disctID.Equals("") || tumbID.Equals(""))
                {
                    txtProvinceCurrentAddressAfterReg.Text = "-";
                    txtDistrictCurrentAddressAfterReg.Text = "-";
                    txtParishCurrentAddressAfterReg.Text   = "-";
                }
                else
                {
                    var lsPV  = biz.GetProvinceById(pvID);
                    var lsAum = biz.GetAmpurById(pvID, disctID);
                    var lsTum = biz.GetTumbonById(pvID, disctID, tumbID);

                    txtList.Add(txtProvinceCurrentAddressAfterReg);
                    txtList.Add(txtDistrictCurrentAddressAfterReg);
                    txtList.Add(txtParishCurrentAddressAfterReg);
                    string[] addressList = { lsPV.DataResponse.Name, lsAum.DataResponse.Name, lsTum.DataResponse.Name };
                    this.SetAddresstoControl(txtList, addressList);
                }
            }
        }
Ejemplo n.º 20
0
        /// <summary>
        /// License Req Validation
        /// </summary>
        /// DataCenterService
        /// <returns>DTO.ResponseMessage<bool></returns>
        public DTO.ResponseMessage <bool> DocRequire()
        {
            DTO.ResponseMessage <bool> res      = new DTO.ResponseMessage <bool>();
            DataCenterBiz            biz        = new DataCenterBiz();
            List <FilesLiceValidate> filesCheck = new List <FilesLiceValidate>();

            //IAS.DTO.ResponseService<IAS.DTO.ConfigDocument[]> getDoc = biz.GetDocumentLicenseConfig(this.MasterLicense.PettionTypeCode, this.MasterLicense.LicenseTypeCode);
            //Get Doc Req
            IAS.DTO.ResponseService <IAS.DTO.ConfigDocument[]> getDoc = biz.GetDocRequire(Convert.ToString(DTO.DocFunction.LICENSE_FUNCTION.GetEnumValue()),
                                                                                          Convert.ToString(this.MasterLicense.UserProfile.MemberType), this.MasterLicense.LicenseTypeCode, this.MasterLicense.PettionTypeCode);

            if (getDoc.DataResponse.Count().Equals(0) && (!getDoc.IsError))
            {
                res.ResultMessage = true;
            }
            else if ((getDoc.DataResponse.Count() > 0) && (!getDoc.IsError))
            {
                try
                {
                    string lccode  = this.MasterLicense.LicenseTypeCode;
                    var    docFunc = getDoc.DataResponse.Where(doc => doc.LICENSE_TYPE_CODE.Equals(this.MasterLicense.LicenseTypeCode) && doc.DOCUMENT_REQUIRE.Equals("Y")).ToList();
                    foreach (BLL.AttachFilesIAS.AttachFile item in this.AttachFiles)
                    {
                        for (int i = 0; i < docFunc.Count; i++)
                        {
                            FilesLiceValidate ent = new FilesLiceValidate();
                            if ((item.ATTACH_FILE_TYPE.Equals(docFunc[i].DOCUMENT_CODE)) && (item.FILE_STATUS != "D"))
                            {
                                ent.Status  = true;
                                ent.DocName = getDoc.DataResponse[i].DOCUMENT_NAME;
                                filesCheck.Add(ent);
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    res.ErrorMsg = "กรุณาติดต่อผู้ดูแลระบบ";
                }

                Func <List <string>, string> getDocName = (doclist) =>
                {
                    StringBuilder docname = new StringBuilder();
                    for (int j = 0; j < doclist.Count(); j++)
                    {
                        docname.Append(" : " + doclist[j].ToString());
                    }
                    doclist[0] = docname.ToString();
                    return(doclist[0]);
                };

                if (filesCheck.Count > 0)
                {
                    if (filesCheck.Where(chk => chk.Status == true).ToList().Count == getDoc.DataResponse.Count())
                    {
                        res.ResultMessage = true;
                    }
                    else
                    {
                        if (MasterLicense != null)
                        {
                            List <string> ls      = getDoc.DataResponse.Select(doct => doct.DOCUMENT_NAME).ToList();
                            string        docNAme = getDocName(ls);
                            this.MasterLicense.UCLicenseUCLicenseModelError.ShowMessageError = SysMessage.FileRequire + docNAme;
                            this.MasterLicense.UCLicenseUCLicenseModelError.ShowModalError();
                            res.ErrorMsg      = SysMessage.FileRequire + docNAme;
                            res.ResultMessage = false;
                        }
                    }
                }
                else if (filesCheck.Count == 0)
                {
                    if (MasterLicense != null)
                    {
                        List <string> ls      = getDoc.DataResponse.Select(doct => doct.DOCUMENT_NAME).ToList();
                        string        docNAme = getDocName(ls);
                        this.MasterLicense.UCLicenseUCLicenseModelError.ShowMessageError = SysMessage.FileRequire.ToString() + docNAme;
                        this.MasterLicense.UCLicenseUCLicenseModelError.ShowModalError();
                        res.ErrorMsg      = SysMessage.FileRequire + docNAme;
                        res.ResultMessage = false;
                    }
                }
            }

            return(res);
        }
Ejemplo n.º 21
0
        protected void btnUploadFile_Click(object sender, EventArgs e)
        {
            if (!fulAttachFile.HasFile)
            {
                AlertMessageShow(SysMessage.CannotUploadFile);
                return;
            }

            var           documentCode = ddlDocumentType.SelectedValue;
            DataCenterBiz dbiz         = new DataCenterBiz();
            var           imgItem      = dbiz.GetPicByDocumentCode(documentCode);

            if (imgItem != null)
            {
                if (!FilterContentTypeImage(fulAttachFile.PostedFile.ContentType))
                {
                    AlertMessageShow(String.Format("ไม่สามารถนำเข้าไฟล์ ประเภท{0} ได้.", fulAttachFile.FileName.Substring(fulAttachFile.FileName.LastIndexOf('.'))));
                    return;
                }
            }
            else
            {
                if (!FilterContentType(fulAttachFile.PostedFile.ContentType))
                {
                    AlertMessageShow(String.Format("ไม่สามารถนำเข้าไฟล์ ประเภท{0} ได้.", fulAttachFile.FileName.Substring(fulAttachFile.FileName.LastIndexOf('.'))));
                    return;
                }
            }

            if (fulAttachFile.FileBytes.LongCount() > 1048576)
            {
                AlertMessageShow(SysMessage.AttachNotOverOneMB);
                return;
            }

            AttachFile attachFile = ConcreateFromControl();

            Stream fileStream = fulAttachFile.PostedFile.InputStream;

            try
            {
                if (ActiveAttachFiles.Where(a => a.ATTACH_FILE_TYPE == attachFile.ATTACH_FILE_TYPE).Count() > 0)
                {
                    if (TempAttachFiles.Where(t => t.ATTACH_FILE_TYPE == attachFile.ATTACH_FILE_TYPE &&
                                              t.FILE_STATUS == AttachFileStatus.Wait.Value()).Count() > 0)
                    {
                        AlertMessageShow(SysMessage.AttachFileDupicate);
                        return;
                    }
                    if (TempAttachFiles.Where(t => t.ATTACH_FILE_TYPE == attachFile.ATTACH_FILE_TYPE &&
                                              t.FILE_STATUS == AttachFileStatus.Delete.Value()).Count() > 0)
                    {
                        var biz = new BLL.UploadDataBiz();
                        UploadFileResponse response = new UploadFileResponse();
                        response = biz.UploadAttachFileToTemp(attachFile, fileStream);

                        if (response.Code != "0000")
                        {
                            AlertMessageShow(response.Message);
                            return;
                        }
                        attachFile.ATTACH_FILE_PATH = response.TargetFullName;

                        AttachFile deleteAttach = _attachFiles.Single(t => t.ATTACH_FILE_TYPE == attachFile.ATTACH_FILE_TYPE &&
                                                                      t.FILE_STATUS == AttachFileStatus.Delete.Value());

                        attachFile.MappingToEntity <AttachFile>(deleteAttach);
                        DefaultValue();
                        BindAttachFile();
                    }
                    else
                    {
                        AlertMessageShow(SysMessage.AttachFileDupicate);
                        return;
                    }
                }
                else
                {
                    if (TempAttachFiles.Where(t => t.ATTACH_FILE_TYPE == ddlDocumentType.SelectedValue &&
                                              t.FILE_STATUS == AttachFileStatus.Wait.Value()).Count() > 0)
                    {
                        AlertMessageShow(SysMessage.AttachFileDupicate);
                        return;
                    }
                    else
                    {
                        var biz = new BLL.UploadDataBiz();
                        UploadFileResponse response = new UploadFileResponse();
                        //response = biz.UploadAttachFileToTemp(attachFile, fileStream);
                        response = biz.UploadAttachFileLicenseToTemp(attachFile, fileStream);


                        if (response.Code != "0000")
                        {
                            AlertMessageShow(response.Message);
                            return;
                        }
                        attachFile.ATTACH_FILE_PATH = response.TargetFullName;

                        _attachFiles.Add(attachFile);
                        DefaultValue();
                        BindAttachFile();


                        //Add to masterLicense
                        this.MasterLicense.AttachFiles = _attachFiles;
                    }
                }
            }
            catch (Exception ex)
            {
                AlertMessageShow(ex.Message);
            }

            udpAttachFiles.Update();
        }
Ejemplo n.º 22
0
        private void StatusInit()
        {
            PersonBiz biz = new PersonBiz();

            DTO.UserProfile userProfile = (DTO.UserProfile)Session[PageList.UserProfile];

            if (userProfile != null)
            {
                //DTO.ResponseService<DTO.Person> res = biz.GetById(userProfile.IdCard);

                if (userProfile.MemberType.Equals((int)DTO.MemberType.General))
                {
                    DTO.ResponseService <DTO.Person> res = biz.GetUserProfile(userProfile.Id, userProfile.MemberType.ToString());


                    if (res.DataResponse != null)
                    {
                        string name;
                        name         = Chklength(res.DataResponse);
                        lblUser.Text = name;
                    }
                }
                else if (userProfile.MemberType.Equals((int)DTO.MemberType.Insurance))
                {
                    DTO.ResponseService <DTO.Person> res = biz.GetUserProfile(userProfile.Id, userProfile.MemberType.ToString());
                    if (res.DataResponse != null)
                    {
                        string name;
                        name         = Chklength(res.DataResponse);
                        lblUser.Text = name;
                        //res.DataResponse = Chklength(res.DataResponse);
                        //lblUser.Text = res.DataResponse.NAMES + " " + res.DataResponse.LASTNAME;
                    }
                }
                else if (userProfile.MemberType.Equals((int)DTO.MemberType.Association))
                {
                    DTO.ResponseService <DTO.Person> res = biz.GetUserProfile(userProfile.Id, userProfile.MemberType.ToString());
                    if (res.DataResponse != null)
                    {
                        string name;
                        name         = Chklength(res.DataResponse);
                        lblUser.Text = name;
                        //  res.DataResponse = Chklength(res.DataResponse);
                        //  lblUser.Text = res.DataResponse.NAMES + " " + res.DataResponse.LASTNAME;
                    }
                }
                else if (userProfile.MemberType.Equals((int)DTO.MemberType.OIC))
                {
                    DTO.ResponseService <DTO.Person> res = biz.GetById(userProfile.Id);
                    if (res.DataResponse != null)
                    {
                        string name;
                        name         = Chklength(res.DataResponse);
                        lblUser.Text = name;
                        //  res.DataResponse = Chklength(res.DataResponse);
                        //  lblUser.Text = res.DataResponse.NAMES + " " + res.DataResponse.LASTNAME;
                    }
                }
                else if (userProfile.MemberType.Equals((int)DTO.MemberType.OICAgent))
                {
                    DTO.ResponseService <DTO.Person> res = biz.GetById(userProfile.Id);
                    if (res.DataResponse != null)
                    {
                        string name;
                        name         = Chklength(res.DataResponse);
                        lblUser.Text = name;
                        // res.DataResponse = Chklength(res.DataResponse);
                        //  lblUser.Text = res.DataResponse.NAMES + " " + res.DataResponse.LASTNAME;
                    }
                }
                else if (userProfile.MemberType.Equals((int)DTO.MemberType.OICFinance))
                {
                    DTO.ResponseService <DTO.Person> res = biz.GetById(userProfile.Id);
                    if (res.DataResponse != null)
                    {
                        string name;
                        name         = Chklength(res.DataResponse);
                        lblUser.Text = name;
                        //  res.DataResponse = Chklength(res.DataResponse);
                        // lblUser.Text = res.DataResponse.NAMES + " " + res.DataResponse.LASTNAME;
                    }
                }
                else if (userProfile.MemberType.Equals((int)DTO.MemberType.TestCenter))
                {
                    DTO.ResponseService <DTO.Person> res = biz.GetById(userProfile.Id);
                    if (res.DataResponse != null)
                    {
                        string name;
                        name         = Chklength(res.DataResponse);
                        lblUser.Text = name;
                        //  res.DataResponse = Chklength(res.DataResponse);
                        //  lblUser.Text = res.DataResponse.NAMES + " " + res.DataResponse.LASTNAME;
                    }
                }

                // this.lblUser.Text = "ชื่อผู้ใช้ : " + userProfile.Name + " "+ userProfile.LastName+" ("+ userProfile.MemberType +")";

                //this.lblUser.Text = ((userProfile.LastName == null)? userProfile.Name : userProfile.Name + " " + userProfile.LastName);

                try
                {
                    DataCenterBiz databiz = new DataCenterBiz();
                    var           list    = databiz.GetMemberTypeAll("").DataResponse;
                    lbl_status.Text = list.FirstOrDefault(x => x.Id == userProfile.MemberType.ToString()).Name;
                }
                catch { }
                //if (userProfile.MemberType == 1)
                //{
                //    lbl_status.Text = Resources.propReg_NotApprove_MemberTypeGeneral;
                //}
                //else if (userProfile.MemberType == 2)
                //{
                //    lbl_status.Text = Resources.propReg_Co_MemberTypeCompany;
                //}
                //else if (userProfile.MemberType == 3)
                //{
                //    lbl_status.Text = Resources.propReg_Assoc_MemberTypeAssoc;
                //}
                //else if (userProfile.MemberType == 4)
                //{
                //    lbl_status.Text = Resources.propSite1_OICAdmin;
                //}
                //else if (userProfile.MemberType == 5)
                //{
                //    lbl_status.Text = Resources.propSite1_OICFinace;
                //}
                //else if (userProfile.MemberType == 6)
                //{
                //    lbl_status.Text = Resources.propSite1_OICAgent;
                //}
                //else
                //{
                //    lbl_status.Text = Resources.propReg_Place_Group_001;
                //}
            }
            else
            {
                this.lblUser.Text = string.Empty;
            }
        }