Пример #1
0
        /// <summary>
        /// Update : ตั้งค่าเอกสารสมาชิก
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <EDITOR>Natta</EDITOR>
        /// <LASTUPDATE>09/08/2557</LASTUPDATE>
        protected void btnSubmitConfigDocument_Click(object sender, EventArgs e)
        {
            var data = new List <DTO.ConfigDocument>();

            foreach (GridViewRow gr in gvConfigDocument.Rows)
            {
                Label strNo = (Label)gr.FindControl("lblNo");

                if (((CheckBox)gr.FindControl("chkDocumentRequire")).Checked == true)
                {
                    data.Add(new DTO.ConfigDocument
                    {
                        ID = Convert.ToInt16(strNo.Text),
                        DOCUMENT_REQUIRE = "Y",
                    });
                }
                else
                {
                    data.Add(new DTO.ConfigDocument
                    {
                        ID = Convert.ToInt16(strNo.Text),
                        DOCUMENT_REQUIRE = "N",
                    });
                }
            }

            if (data != null)
            {
                var biz = new BLL.DataCenterBiz();

                var res = biz.UpdateConfigApproveLicense(data, base.UserProfile);

                if (res.IsError)
                {
                    var errorMsg = res.ErrorMsg;

                    UCModalError.ShowMessageError = res.ErrorMsg;
                    UCModalError.ShowModalError();
                }
                else
                {
                    UCModalSuccess.ShowMessageSuccess = SysMessage.SuccessConfigLicense;
                    UCModalSuccess.ShowModalSuccess();
                    GetConfigDocumentGrid();
                    GetMemberType();
                    GetDocumentType();
                    ClearConfigDocumentValue();
                    UpdatePanelGrid.Update();
                }
            }
        }
Пример #2
0
        public Boolean SaveChanges()
        {
            BLL.DataCenterBiz          biz             = new BLL.DataCenterBiz();
            IList <DTO.ConfigDocument> configDocuments = new List <DTO.ConfigDocument>();

            foreach (GridViewRow row in this.Rows)
            {
                String             id         = ((Label)row.Cells[0].Controls[0]).Text;
                Boolean            checkValue = ((CheckBox)row.Cells[4].Controls[0]).Checked;
                DTO.ConfigDocument config     = new DTO.ConfigDocument();
                config.ID = Convert.ToInt16(id);
                config.DOCUMENT_REQUIRE = (checkValue) ? "Y" : "N";
                configDocuments.Add(config);
            }
            DTO.UserProfile profile           = (DTO.UserProfile)Context.Session[PageList.UserProfile];
            DTO.ResponseMessage <Boolean> res = biz.UpdateConfigApproveLicense(configDocuments.ToList(), profile);
            if (res.IsError)
            {
                return(false);
            }

            return(true);
        }