Esempio n. 1
0
        protected void LinkButtonDelete_Click(Object sender, EventArgs e)
        {
            var gv = (GridViewRow)((LinkButton)sender).NamingContainer;
            //gv.Cells[0].Visible = true;
            string strNo = ((Label)gv.Cells[0].Controls[0]).Text;

            BLL.DataCenterBiz biz      = new BLL.DataCenterBiz();
            DTO.UserProfile   profiles = (DTO.UserProfile)HttpContext.Current.Session[PageList.UserProfile];
            string            Alert    = "confirm('" + Resources.infoSettingAttach_001 + "')";

            ToolkitScriptManager.RegisterClientScriptBlock(this, this.GetType(), "confirm", Alert, true);
            var res = biz.DeleteConfigDocument(Convert.ToInt16(strNo), profiles);

            if (res.IsError)
            {
                UCModalError.ShowMessageError = res.ErrorMsg;
                UCModalError.ShowModalError();
            }
            else
            {
                UCModalSuccess.ShowMessageSuccess = SysMessage.DeleteConfigLicense;
                UCModalSuccess.ShowModalSuccess();
                UpdatePanelGrid.Update();
            }
        }
Esempio n. 2
0
        /// <summary>
        /// AddNew : ตั้งค่าเอกสารขอรับใบอนุญาต
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <EDITOR>Natta</EDITOR>
        /// <LASTUPDATE>09/08/2557</LASTUPDATE>
        protected void btnInsertConfigLicense_Click(object sender, EventArgs e)
        {
            if (ddlPetitionType.SelectedIndex > 0 && ddlLicenseType.SelectedIndex > 0 && ddlLicenseDocumentType.SelectedIndex > 0)
            {
                BLL.DataCenterBiz  biz = new BLL.DataCenterBiz();
                DTO.ConfigDocument doc = new DTO.ConfigDocument();
                var detail             = biz.GetConfigDocumentLicense(ddlPetitionType.SelectedValue, ddlLicenseType.SelectedValue, ddlLicenseDocumentType.SelectedValue);
                if (detail.DataResponse != null)
                {
                    UCModalError.ShowMessageError = SysMessage.DupConfigSettingDocument;
                    UCModalError.ShowModalError();
                    UpdatePanelGrid.Update();
                }
                else
                {
                    doc.FUNCTION_ID        = "41";
                    doc.PETITION_TYPE_CODE = ddlPetitionType.SelectedValue;
                    doc.LICENSE_TYPE_CODE  = ddlLicenseType.SelectedValue;
                    doc.DOCUMENT_CODE      = ddlLicenseDocumentType.SelectedValue;
                    doc.CREATED_BY         = base.UserProfile.Name;
                    doc.CREATED_DATE       = DateTime.Today.ToString();
                    doc.UPDATED_DATE       = DateTime.Today.ToString();
                    doc.UPDATED_BY         = base.UserProfile.Name;
                    if (chkDocumentLicense.Checked == true)
                    {
                        doc.DOCUMENT_REQUIRE = "Y";
                    }
                    else
                    {
                        doc.DOCUMENT_REQUIRE = "N";
                    }
                    doc.STATUS = "A";
                    var res = biz.InsertConfigDocument(doc, base.UserProfile);
                    if (res.IsError)
                    {
                        UCModalError.ShowMessageError = res.ErrorMsg;
                        UCModalError.ShowModalError();
                    }
                    else
                    {
                        UCModalSuccess.ShowMessageSuccess = SysMessage.InsertSuccess;
                        UCModalSuccess.ShowModalSuccess();
                        UpdatePanelGrid.Update();
                    }
                }
            }
            else
            {
                BindDataLicenseTab();
                dvSubmitConfigLicense.Style.Add("display", "none");
                CreateTab();
                UpdatePanelGrid.Update();

                UCModalError.ShowMessageError = SysMessage.PleaseInputFill;
                UCModalError.ShowModalError();
            }
        }
Esempio n. 3
0
 /// <summary>
 /// Binds object to be listed.
 /// </summary>
 protected virtual void Bind()
 {
     try
     {
         GridUtils.Reset();
         GridUtils.Bind();
         UpdatePanelGrid.Update();
     }
     catch (Exception ex) { ShowError(ex); }
 }
Esempio n. 4
0
        protected void btnOkInspectorDoc_Click(object sender, EventArgs e)
        {
            var data = new List <DTO.ConfigEntity>();

            foreach (GridViewRow gr in gvInspectorDoc.Rows)
            {
                var lblIdGvInspectorDoc           = (Label)gr.FindControl("lblIdGvInspectorDoc");
                var ddlInspector                  = (DropDownList)gr.FindControl("ddlInspector");
                var chkSpecifiedValueInspectorDoc = (CheckBox)gr.FindControl("chkSpecifiedValueInspectorDoc");

                if (((CheckBox)gr.FindControl("chkSpecifiedValueInspectorDoc")).Checked == true)
                {
                    data.Add(new DTO.ConfigEntity
                    {
                        Id         = lblIdGvInspectorDoc.Text,
                        Value      = ddlInspector.SelectedValue,
                        Item_Value = "Y"
                    });
                }
                else
                {
                    data.Add(new DTO.ConfigEntity
                    {
                        Id         = lblIdGvInspectorDoc.Text,
                        Value      = ddlInspector.SelectedValue,
                        Item_Value = "N"
                    });
                }
            }

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

                var res = biz.UpdateConfigApproveDocument(data);

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

                    UCModalError.ShowMessageError = res.ErrorMsg;
                    UCModalError.ShowModalError();
                }
                else
                {
                    UCModalSuccess.ShowMessageSuccess = "บันทึกข้อมูลเรียบร้อย";
                    UCModalSuccess.ShowModalSuccess();
                    BindDataInGridView();
                    UpdatePanelGrid.Update();
                }
            }
            //var biz = new BLL.DataCenterBiz();

            //var res = biz.UpdateConfigApproveDocument(
        }
Esempio n. 5
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();
                }
            }
        }
Esempio n. 6
0
        private void FillGrid()
        {
            try
            {
                DataTable DtList = null;


                if (ViewState["grdUserName"] == null)
                {
                    if (ddlUserTypeSearch.SelectedIndex > 0)
                    {
                        objML_UserName.UserTypeId = ML_Common.string2int32(ML_Common.GetDropDownValue(ddlUserTypeSearch, true));
                        objML_UserName.UserType   = ML_Common.string2string(ML_Common.GetDropDownValue(ddlUserTypeSearch, false));

                        DtList = BindGridViewBySearch(objML_UserName);
                        ViewState["grdUserName"] = DtList;
                    }
                }
                else
                {
                    DtList = (DataTable)ViewState["grdUserName"];
                }

                if (DtList != null)
                {
                    if (DtList.Rows.Count > 0)
                    {
                        grdUserName.DataSource = DtList;
                        grdUserName.DataBind();
                    }
                    else
                    {
                        DtList.Rows.Add(DtList.NewRow());
                        grdUserName.DataSource = DtList;
                        grdUserName.DataBind();

                        int TotalColumns = grdUserName.Rows[0].Cells.Count;
                        grdUserName.Rows[0].Cells.Clear();
                        grdUserName.Rows[0].Cells.Add(new TableCell());
                        grdUserName.Rows[0].Cells[0].ColumnSpan = TotalColumns;
                        grdUserName.Rows[0].Cells[0].Text       = "No Record Found";
                    }

                    UpdatePanelGrid.Update();
                }
            }
            catch (Exception ex)
            {
                Exception exx = ex;
            }
        }
Esempio n. 7
0
        protected void btnOkApproveRegis_Click(object sender, EventArgs e)
        {
            var data = new List <DTO.ConfigEntity>();

            foreach (GridViewRow gr in gvApproveRegis.Rows)
            {
                var lblIdGvApproveRegis    = (Label)gr.FindControl("lblIdGvApproveRegis");
                var lblValueGvApproveRegis = (Label)gr.FindControl("lblValueGvApproveRegis");

                if (((CheckBox)gr.FindControl("chkSpecifiedValue")).Checked == true)
                {
                    data.Add(new DTO.ConfigEntity
                    {
                        Id    = lblIdGvApproveRegis.Text,
                        Value = "Y"
                    });
                }
                else
                {
                    data.Add(new DTO.ConfigEntity
                    {
                        Id    = lblIdGvApproveRegis.Text,
                        Value = "N"
                    });
                }
            }

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

                var res = biz.UpdateConfigApproveMember(data);

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

                    UCModalError.ShowMessageError = res.ErrorMsg;
                    UCModalError.ShowModalError();
                }
                else
                {
                    UCModalSuccess.ShowMessageSuccess = "บันทึกข้อมูลเรียบร้อย";
                    UCModalSuccess.ShowModalSuccess();
                    BindDataInGridView();
                    UpdatePanelGrid.Update();
                }
            }
        }
Esempio n. 8
0
        private void FillGrid()
        {
            try
            {
                DataTable DtList = null;
                if (ViewState["grdCokeSupplier"] == null)
                {
                    ML_CokeSupplier objML_CokeSupplierh = new ML_CokeSupplier();
                    objML_CokeSupplierh.CokeSupplier = ML_Common.clean(txtCokeSupplierSearch.Text);
                    objBusinessClass = new BusinessLayer.BusinessClass();
                    DtList           = objBusinessClass.GetCokeSupplierBySeacrh(objML_CokeSupplierh);


                    ViewState["grdCokeSupplier"] = DtList;
                }
                else
                {
                    DtList = (DataTable)ViewState["grdCokeSupplier"];
                }

                if (DtList != null)
                {
                    // DtList = (DataTable)ViewState["grdPitchType"];
                    if (DtList.Rows.Count > 0)
                    {
                        grdCokeSupplier.DataSource = DtList;
                        grdCokeSupplier.DataBind();
                    }
                    else
                    {
                        DtList.Rows.Add(DtList.NewRow());
                        grdCokeSupplier.DataSource = DtList;
                        grdCokeSupplier.DataBind();

                        int TotalColumns = grdCokeSupplier.Rows[0].Cells.Count;
                        grdCokeSupplier.Rows[0].Cells.Clear();
                        grdCokeSupplier.Rows[0].Cells.Add(new TableCell());
                        grdCokeSupplier.Rows[0].Cells[0].ColumnSpan = TotalColumns;
                        grdCokeSupplier.Rows[0].Cells[0].Text       = "No Record Found";
                    }
                    UpdatePanelGrid.Update();
                }
            }
            catch (Exception ex)
            {
                Exception exc = ex;// LogManager.LogManager.WriteErrorLog(ex);
            }
        }
Esempio n. 9
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();
                }
            }
        }
Esempio n. 10
0
        private void BindDDL()
        {
            UpdatePanelGrid.Update();

            FillRetailer();

            if (strStoreNameDDL != WebStoreNameDDL.SelectedValue)
            {
                strStoreNameDDL = WebStoreNameDDL.SelectedValue;


                if (!string.IsNullOrWhiteSpace(strStoreNameDDL))
                {
                    List <string> lstPrograms = new List <string>();
                    if (strStoreNameDDL != "Kroger All")
                    {
                        lstPrograms = dtStoreProgOwnerInSales.AsEnumerable()
                                      .Where(f => f.Field <string>("Program") != "" && f.Field <string>("StoreName") == strStoreNameDDL)
                                      .OrderBy(f => f.Field <string>("Program"))
                                      .Select(f => f.Field <string>("Program"))
                                      .Distinct().ToList();
                    }
                    else
                    {
                        lstPrograms = dtStoreProgOwnerInSales.AsEnumerable()
                                      .Where(f => f.Field <string>("StoreName").Contains("Kroger") && f.Field <string>("Program") != "" && f.Field <string>("Program") != null)
                                      .OrderBy(f => f.Field <string>("Program"))
                                      .Select(f => f.Field <string>("Program"))
                                      .Distinct().ToList();
                    }

                    lstPrograms.Insert(0, "--Select--");
                    WebProgramDDL.DataSource = lstPrograms;
                    WebProgramDDL.DataBind();
                }
            }

            if (strStoreNameDDL != WebStoreNameDDL.SelectedValue || strProgramDDL != WebProgramDDL.SelectedValue || strRotationDDL != WebRotationDDL.SelectedValue)
            {
                FillOwner();
            }

            strProgramDDL = WebProgramDDL.SelectedValue;
            strOwnerDDL   = WebOwnerDDL.SelectedValue;
        }
Esempio n. 11
0
        /// <summary>
        /// Load Individual list and refresh update panel
        /// </summary>
        private void LoadIndividuals()
        {
            try
            {
                DBContext = new IWTestEntities();
                var Individuals = DBContext.Individual.ToList();
                IndividualsGridView.DataSource = Individuals;
                IndividualsGridView.DataBind();

                UpdatePanelGrid.Update();
                IndividualsGridView.HeaderRow.TableSection = TableRowSection.TableHeader;
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script2", "initTable();", true);
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "alert('" + ex.Message + "');", true);
            }
        }
Esempio n. 12
0
        private void BindDataInGridView()
        {
            var biz = new BLL.ExamScheduleBiz();
            var res = biz.ManageApplicantIn_OutRoom();

            if (res.IsError)
            {
                UCModalError.ShowMessageError = res.ErrorMsg;
                UCModalError.ShowModalError();
            }
            else
            {
                gvApproveRegis.DataSource = res.DataResponse;
                gvApproveRegis.DataBind();
            }


            UpdatePanelGrid.Update();
        }
        protected void btnNewAdd_Click(object sender, EventArgs e)
        {
            try
            {
                ML_Common.SetDropDownValue(ddlCokeType, -1);
                ML_Common.SetDropDownValue(ddlCokeSupplier, -1);
                ML_Common.SetDropDownValue(ddlAnalysisType, -1);
                txtFieldSize.Text = string.Empty;
                txtFieldUnit.Text = string.Empty;
                txtFieldSpec.Text = string.Empty;
                txtMinValue.Text  = string.Empty;
                txtMaxValue.Text  = string.Empty;



                ViewState["dtCokeDynamic"] = null;
                dtCokeDynamic = new DataTable();
                dtCokeDynamic = BindCokeDynamicDataTable();

                dtCokeDynamic.Rows.Add(dtCokeDynamic.NewRow());
                grdCokeDynamic.DataSource = dtCokeDynamic;
                grdCokeDynamic.DataBind();

                //int TotalColumns = grdCokeComposite.Rows[0].Cells.Count;
                //grdCokeComposite.Rows[0].Cells.Clear();
                //grdCokeComposite.Rows[0].Cells.Add(new TableCell());
                //grdCokeComposite.Rows[0].Cells[0].ColumnSpan = TotalColumns;
                //grdCokeComposite.Rows[0].Cells[0].Text = "No Record Found";

                btnSubmit.Visible = false;
                btnNewAdd.Visible = false;



                UpdatePanelSave.Update();
                UpdatePanelGrid.Update();
            }
            catch (Exception ex)
            {
                Exception exc = ex;// LogManager.LogManager.WriteErrorLog(ex);
            }
        }
Esempio n. 14
0
        private void BindGrid()
        {
            UpdatePanelGrid.Update();
            if (WebStoreNameDDL.SelectedValue != "--Select--" &&
                WebProgramDDL.SelectedValue != "--Select--")
            {
                List <DataTable> lstdtResults = BuildReport();
                lstdtResults.Add(BuildSummaryReport());

                GRVSummary.DataSource = lstdtResults[2];
                GRVSummary.DataBind();

                if (lstdtResults[0].AsEnumerable().Where(f => f.Field <string>("Owner") != null).ToList().Count() == 0)
                {
                    GRVQty.DataSource = lstdtResults[0];
                    GRVQty.DataBind();

                    GRVRev.DataSource = lstdtResults[1];
                    GRVRev.DataBind();
                }
                else
                {
                    GRVQty.DataSource = SortSalesByTotal(lstdtResults[0]);
                    GRVQty.DataBind();

                    GRVRev.DataSource = SortSalesByTotal(lstdtResults[1]);
                    GRVRev.DataBind();
                }

                Session["ReportsToPrint"] = lstdtResults;
            }
            else
            {
                GRVSummary.DataSource = null;
                GRVSummary.DataBind();
                GRVQty.DataSource = null;
                GRVQty.DataBind();
                GRVRev.DataSource = null;
                GRVRev.DataBind();
            }
        }
Esempio n. 15
0
        protected void hplDeleteDocumentType_Click(object sender, EventArgs e)
        {
            var gv    = (GridViewRow)((LinkButton)sender).NamingContainer;
            var strNo = (Label)gv.FindControl("lblNo");

            BLL.DataCenterBiz biz = new BLL.DataCenterBiz();
            var res = biz.DeleteDocumentType(strNo.Text);

            if (res.IsError)
            {
                UCModalError.ShowMessageError = res.ErrorMsg;
                UCModalError.ShowModalError();
            }
            else
            {
                UCModalSuccess.ShowMessageSuccess = SysMessage.DeleteSuccess;
                UCModalSuccess.ShowModalSuccess();
                GetDocumentTypeGrid();
                UpdatePanelGrid.Update();
            }
        }
Esempio n. 16
0
        /// <summary>
        /// Delete : ตั้งค่าเอกสารแนบแก้ไขข้อมูลผู้สมัครสอบ
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <EDITOR>Natta</EDITOR>
        /// <LASTUPDATE>09/08/2557</LASTUPDATE>
        protected void hplDeleteApplicantDetail_Click(object sender, EventArgs e)
        {
            var gv    = (GridViewRow)((LinkButton)sender).NamingContainer;
            var strNo = (Label)gv.FindControl("lblNo");

            BLL.DataCenterBiz biz = new BLL.DataCenterBiz();
            var res = biz.DeleteConfigDocument(Convert.ToUInt16(strNo.Text), base.UserProfile);

            if (res.IsError)
            {
                UCModalError.ShowMessageError = res.ErrorMsg;
                UCModalError.ShowModalError();
            }
            else
            {
                UCModalSuccess.ShowMessageSuccess = SysMessage.DeleteSuccess;
                UCModalSuccess.ShowModalSuccess();
                GetApplicantDetailtGrid();
                //GetConfigDocumentGrid();
                UpdatePanelGrid.Update();
            }
        }
Esempio n. 17
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();
            }
        }
Esempio n. 18
0
        /// <summary>
        /// GridViewDataBindSingleMode
        /// </summary>
        /// <param name="LayerMode">String</param>
        /// <LASTUPDATE>08/08/2557</LASTUPDATE>
        /// <AUTHOR>Natta</AUTHOR>
        private void GridViewDataBindSingleMode(string LayerMode)
        {
            BLL.DataCenterBiz biz = new BLL.DataCenterBiz();

            if (LayerMode.Equals("1"))
            {
                /*1. GetConfigApproveMember*/
                var res = biz.GetConfigApproveMember();

                if (res.IsError)
                {
                    UCModalError.ShowMessageError = res.ErrorMsg;
                    UCModalError.ShowModalError();
                }
                else
                {
                    gvApproveRegis.DataSource = res.DataResponse;
                    gvApproveRegis.DataBind();
                }
                /*1. GetConfigApproveMember*/
            }
            else if (LayerMode.Equals("2"))
            {
                //Config อนุมัติสมัครสมาชิก เพิ่มเติม
                this.GetNewRegistrationApprove();
            }
            else if (LayerMode.Equals("3"))
            {
                /*2. GetConfigApproveDocument*/
                var res2 = biz.GetConfigApproveDocument();

                if (res2.IsError)
                {
                    UCModalError.ShowMessageError = res2.ErrorMsg;
                    UCModalError.ShowModalError();
                }
                else
                {
                    gvInspectorDoc.DataSource = res2.DataResponse;
                    gvInspectorDoc.DataBind();
                }
                /*2. GetConfigApproveDocument*/
            }
            else if (LayerMode.Equals("4"))
            {
                /*3. GetConfigGeneral*/
                var res3 = biz.GetConfigGeneral();

                if (res3.IsError)
                {
                    UCModalError.ShowMessageError = res3.ErrorMsg;
                    UCModalError.ShowModalError();
                }
                else
                {
                    gvGeneral.DataSource = res3.DataResponse;
                    gvGeneral.DataBind();
                }
                /*3. GetConfigGeneral*/
            }
            else if (LayerMode.Equals("5"))
            {
                // Config Check Exam License
                var res4 = biz.GetConfigCheckExamLicense();
                if (res4.IsError)
                {
                    UCModalError.ShowMessageError = res4.ErrorMsg;
                    UCModalError.ShowModalError();
                }
                else
                {
                    gvCfgCheckExamLicense.DataSource = res4.DataResponse;
                    gvCfgCheckExamLicense.DataBind();
                }
            }

            UpdatePanelGrid.Update();
        }
Esempio n. 19
0
        private void BindDataInGridView()
        {
            /*1. GetConfigApproveMember*/
            var biz = new BLL.DataCenterBiz();
            var res = biz.GetConfigApproveMember();

            if (res.IsError)
            {
                UCModalError.ShowMessageError = res.ErrorMsg;
                UCModalError.ShowModalError();
            }
            else
            {
                gvApproveRegis.DataSource = res.DataResponse;
                gvApproveRegis.DataBind();
            }
            /*1. GetConfigApproveMember*/


            /*3. GetConfigGeneral*/
            var res3 = biz.GetConfigGeneral();

            if (res3.IsError)
            {
                UCModalError.ShowMessageError = res3.ErrorMsg;
                UCModalError.ShowModalError();
            }
            else
            {
                gvGeneral.DataSource = res3.DataResponse;
                gvGeneral.DataBind();
            }
            /*3. GetConfigGeneral*/

            /*2. GetConfigApproveDocument*/
            var res2 = biz.GetConfigApproveDocument();

            if (res2.IsError)
            {
                UCModalError.ShowMessageError = res2.ErrorMsg;
                UCModalError.ShowModalError();
            }
            else
            {
                gvInspectorDoc.DataSource = res2.DataResponse;
                gvInspectorDoc.DataBind();
            }
            /*2. GetConfigApproveDocument*/


            //Config อนุมัติสมัครสมาชิก เพิ่มเติม
            this.GetNewRegistrationApprove();

            // Config Check Exam License
            var res4 = biz.GetConfigCheckExamLicense();

            if (res4.IsError)
            {
                UCModalError.ShowMessageError = res4.ErrorMsg;
                UCModalError.ShowModalError();
            }
            else
            {
                gvCfgCheckExamLicense.DataSource = res4.DataResponse;
                gvCfgCheckExamLicense.DataBind();
            }

            UpdatePanelGrid.Update();
        }
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            try
            {
                if (btnAdd.Enabled)
                {
                    DataRow dr;

                    if (ViewState["dtCokeDynamic"] == null)
                    {
                        dtCokeDynamic = new DataTable();
                        dtCokeDynamic = BindCokeDynamicDataTable();
                    }
                    else
                    {
                        dtCokeDynamic = (DataTable)ViewState["dtCokeDynamic"];
                    }



                    dr = dtCokeDynamic.NewRow();
                    dr["CokeTypeId"] = ML_Common.string2int32(ML_Common.GetDropDownValue(ddlCokeType, true));
                    dr["CokeType"]   = ML_Common.string2string(ML_Common.GetDropDownValue(ddlCokeType, false));


                    dr["CokeSupplierId"] = ML_Common.string2int32(ML_Common.GetDropDownValue(ddlCokeSupplier, true));
                    dr["CokeSupplier"]   = ML_Common.string2string(ML_Common.GetDropDownValue(ddlCokeSupplier, false));
                    //dr["NameofParty"] = dr["CokeSupplier"];

                    dr["AnalysisTypeId"] = ML_Common.string2int32(ML_Common.GetDropDownValue(ddlAnalysisType, true));
                    dr["AnalysisType"]   = ML_Common.string2string(ML_Common.GetDropDownValue(ddlAnalysisType, false));
                    //dr["NameofAnalysis"] = dr["AnalysisType"];

                    //dr["SampleNo"] = dtFlowMetrDataTable.Rows.Count + 1;// ML_Common.string2int32(ML_Common.clean(txtSampleNo.Text));
                    //dr["SamplingDate"] = ML_Common.ToDateTimeSafeNull(txtSamplingDate.Text);
                    //dr["StoreSINo"] = ML_Common.string2int32(ML_Common.clean(txtStoreSINo.Text));
                    //dr["SampleDetail"] = ML_Common.clean(txtSampleDetail.Text);

                    dr["FieldSize"] = ML_Common.clean(txtFieldSize.Text);
                    dr["FieldUnit"] = ML_Common.clean(txtFieldUnit.Text);
                    dr["FieldSpec"] = ML_Common.clean(txtFieldSpec.Text);
                    dr["MinValue"]  = ML_Common.clean(txtMinValue.Text);
                    dr["MaxValue"]  = ML_Common.clean(txtMaxValue.Text);



                    dtCokeDynamic.Rows.Add(dr);

                    //DtList = (DataTable)ViewState["grdStartupBathTapping"];
                    if (dtCokeDynamic.Rows.Count > 0)
                    {
                        ViewState["dtCokeDynamic"] = dtCokeDynamic;
                        grdCokeDynamic.DataSource  = dtCokeDynamic;
                        grdCokeDynamic.DataBind();
                    }
                    else
                    {
                        dtCokeDynamic.Rows.Add(dtCokeDynamic.NewRow());
                        grdCokeDynamic.DataSource = dtCokeDynamic;
                        grdCokeDynamic.DataBind();

                        int TotalColumns = grdCokeDynamic.Rows[0].Cells.Count;
                        grdCokeDynamic.Rows[0].Cells.Clear();
                        grdCokeDynamic.Rows[0].Cells.Add(new TableCell());
                        grdCokeDynamic.Rows[0].Cells[0].ColumnSpan = TotalColumns;
                        grdCokeDynamic.Rows[0].Cells[0].Text       = "No Record Found";
                    }


                    txtFieldSize.Text = string.Empty;
                    txtFieldUnit.Text = string.Empty;
                    txtFieldSpec.Text = string.Empty;
                    txtMinValue.Text  = string.Empty;
                    txtMaxValue.Text  = string.Empty;



                    UpdatePanelGrid.Update();
                    btnSubmit.Visible = true;

                    btnSubmit.BackColor = System.Drawing.ColorTranslator.FromHtml("#5bc0de");
                    btnSubmit.ForeColor = System.Drawing.Color.White;



                    btnNewAdd.Visible = true;
                    // btnNewAdd.BackColor = System.Drawing.Color.Green;
                    btnNewAdd.BackColor = System.Drawing.ColorTranslator.FromHtml("#5bc0de");
                    btnSubmit.ForeColor = System.Drawing.Color.White;
                    UpdatePanelSave.Update();
                }
            }
            catch (Exception ex)
            {
                string str = ex.Message.ToString();
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (IsValid)
            {
                //errNumber = -1;
                try
                {
                    if (btnSubmit.Enabled)
                    {
                        int obhReturn = -1;
                        objBusinessClass  = new BusinessLayer.BusinessClass();
                        objML_CokeDynamic = new ML_CokeDynamic();

                        //objML_CokeDynamic.Id = ML_Common.string2Long(ML_Common.clean(txtId.Text));
                        //objML_CokeDynamic.CokeDynamicId = ML_Common.string2Long(ML_Common.clean(txtCokeDynamicId.Text));
                        //objML_CokeDynamic.CokeDynamic = ML_Common.clean(txtCokeDynamic.Text);

                        objML_CokeDynamic.CokeTypeId = ML_Common.string2int32(ML_Common.GetDropDownValue(ddlCokeType, true));
                        objML_CokeDynamic.CokeType   = ML_Common.string2string(ML_Common.GetDropDownValue(ddlCokeType, false));

                        objML_CokeDynamic.CokeSupplierId = ML_Common.string2int32(ML_Common.GetDropDownValue(ddlCokeSupplier, true));
                        objML_CokeDynamic.CokeSupplier   = ML_Common.string2string(ML_Common.GetDropDownValue(ddlCokeSupplier, false));

                        objML_CokeDynamic.AnalysisTypeId = ML_Common.string2int32(ML_Common.GetDropDownValue(ddlAnalysisType, true));
                        objML_CokeDynamic.AnalysisType   = ML_Common.string2string(ML_Common.GetDropDownValue(ddlAnalysisType, false));


                        objML_CokeDynamic.FieldSize = ML_Common.clean(txtFieldSize.Text);
                        objML_CokeDynamic.FieldUnit = ML_Common.clean(txtFieldUnit.Text);
                        objML_CokeDynamic.FieldSpec = ML_Common.clean(txtFieldSpec.Text);
                        objML_CokeDynamic.MinValue  = ML_Common.clean(txtMinValue.Text);
                        objML_CokeDynamic.MaxValue  = ML_Common.clean(txtMaxValue.Text);



                        for (int i = 0; i <= grdCokeDynamic.Rows.Count - 1; i++)
                        {
                            objML_CokeDynamic.FieldSize = string.Empty;
                            objML_CokeDynamic.FieldUnit = string.Empty;
                            objML_CokeDynamic.FieldSpec = string.Empty;
                            objML_CokeDynamic.MinValue  = string.Empty;
                            objML_CokeDynamic.MaxValue  = string.Empty;


                            GridViewRow gRow          = grdCokeDynamic.Rows[i];
                            Label       lblCokeTypeID = (Label)gRow.FindControl("lblCokeTypeID");
                            if (lblCokeTypeID != null)
                            {
                                objML_CokeDynamic.CokeTypeId = ML_Common.string2int32(lblCokeTypeID.Text);
                            }
                            Label lblCokeType = (Label)gRow.FindControl("lblCokeType");
                            if (lblCokeType != null)
                            {
                                objML_CokeDynamic.CokeType = ML_Common.clean(lblCokeType.Text);
                            }



                            Label lblCokeSupplierID = (Label)gRow.FindControl("lblCokeSupplierID");
                            if (lblCokeSupplierID != null)
                            {
                                objML_CokeDynamic.CokeSupplierId = ML_Common.string2int32(lblCokeSupplierID.Text);
                            }
                            Label lblCokeSupplier = (Label)gRow.FindControl("lblCokeSupplier");
                            if (lblCokeSupplier != null)
                            {
                                objML_CokeDynamic.CokeSupplier = ML_Common.clean(lblCokeSupplier.Text);
                            }



                            Label lblAnalysisTypeID = (Label)gRow.FindControl("lblAnalysisTypeID");
                            if (lblAnalysisTypeID != null)
                            {
                                objML_CokeDynamic.AnalysisTypeId = ML_Common.string2int32(lblAnalysisTypeID.Text);
                            }
                            Label lblAnalysisType = (Label)gRow.FindControl("lblAnalysisType");
                            if (lblAnalysisTypeID != null)
                            {
                                objML_CokeDynamic.AnalysisType = ML_Common.clean(lblAnalysisType.Text);
                            }



                            Label lblFieldSize = (Label)gRow.FindControl("lblFieldSize");
                            if (lblFieldSize != null)
                            {
                                objML_CokeDynamic.FieldSize = lblFieldSize.Text;
                            }
                            Label lblFieldUnit = (Label)gRow.FindControl("lblFieldUnit");
                            if (lblFieldUnit != null)
                            {
                                objML_CokeDynamic.FieldUnit = lblFieldUnit.Text;
                            }
                            Label lblFieldSpec = (Label)gRow.FindControl("lblFieldSpec");
                            if (lblFieldSpec != null)
                            {
                                objML_CokeDynamic.FieldSpec = lblFieldSpec.Text;
                            }
                            Label lblMinValue = (Label)gRow.FindControl("lblMinValue");
                            if (lblMinValue != null)
                            {
                                objML_CokeDynamic.MinValue = lblMinValue.Text;
                            }
                            Label lblMaxValue = (Label)gRow.FindControl("lblMaxValue");
                            if (lblMaxValue != null)
                            {
                                objML_CokeDynamic.MaxValue = lblMaxValue.Text;
                            }
                            obhReturn = objBusinessClass.AddCokeDynamic(objML_CokeDynamic);
                        }

                        if (obhReturn == 1)
                        {
                            lblMsg.Text       = "Record Update Successfully";
                            lblMsgEdit.Text   = "Record Update Successfully";
                            btnSubmit.Visible = false;
                            UpdatePanelSave.Update();
                        }
                        else
                        {
                            lblMsg.Text     = "Ooops!OtherIssue...";
                            lblMsgEdit.Text = "Ooops!OtherIssue...";
                        }
                        txtFieldSize.Text = string.Empty;
                        txtFieldUnit.Text = string.Empty;
                        txtFieldSpec.Text = string.Empty;
                        txtMinValue.Text  = string.Empty;
                        txtMaxValue.Text  = string.Empty;

                        lblMsg.Text     = string.Empty;
                        lblMsgEdit.Text = string.Empty;
                        UpdatePanelSave.Update();
                        btnSubmit.Enabled = true;

                        ViewState["dtCokeDynamic"] = null;

                        dtCokeDynamic             = new DataTable();
                        dtCokeDynamic             = BindCokeDynamicDataTable();
                        grdCokeDynamic.DataSource = dtCokeDynamic;
                        grdCokeDynamic.DataBind();
                        UpdatePanelGrid.Update();

                        btnAdd.Enabled = true;
                        //btnSubmit.Visible = false;
                    }
                }

                catch (Exception ex)
                {
                    Exception exc = ex;// Exception exc=ex;// LogManager.LogManager.WriteErrorLog(ex);
                }
            }
        }
Esempio n. 22
0
        protected void btnOkApproveRegis_Click(object sender, EventArgs e)
        {
            var data = new List <DTO.ConfigEntity>();

            foreach (GridViewRow gr in gvApproveRegis.Rows)
            {
                Label lblIdGvApproveRegis = (Label)gr.FindControl("lblIdGvApproveRegis");
                //Label lblValueGvApproveRegis = (Label)gr.FindControl("lblValueGvApproveRegis");
                DropDownList ddlDateExpiration = (DropDownList)gr.FindControl("ddlDateExpiration");
                if (lblIdGvApproveRegis.Text == "09")
                {
                    if (((CheckBox)gr.FindControl("chkSpecifiedValue")).Checked == true)
                    {
                        data.Add(new DTO.ConfigEntity
                        {
                            Id         = lblIdGvApproveRegis.Text,
                            GROUP_CODE = "AP001",
                            Value      = "1"
                        });
                    }
                    else
                    {
                        data.Add(new DTO.ConfigEntity
                        {
                            Id         = lblIdGvApproveRegis.Text,
                            GROUP_CODE = "AP001",
                            Value      = "0"
                        });
                    }
                }
                else if (lblIdGvApproveRegis.Text == "10")
                {
                    data.Add(new DTO.ConfigEntity
                    {
                        Id         = lblIdGvApproveRegis.Text,
                        GROUP_CODE = "AP001",
                        Value      = ddlDateExpiration.SelectedValue
                    });
                }
            }

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

                var res = biz.UpdateManageApplicantIn_OutRoom(data);

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

                    UCModalError.ShowMessageError = res.ErrorMsg;
                    UCModalError.ShowModalError();
                }
                else
                {
                    UCModalSuccess.ShowMessageSuccess = "บันทึกเรียบร้อย";
                    UCModalSuccess.ShowModalSuccess();
                    BindDataInGridView();
                    UpdatePanelGrid.Update();
                }
            }
        }
        private void FillGrid()
        {
            try
            {
                DataTable DtList = null;

                ML_SanitizationReport objML_SanitizationReportSearch = new ML_SanitizationReport();

                if (ddlReportTypeSearch.SelectedIndex > 0 && !string.IsNullOrEmpty(txtFromDateSearch.Text) && !string.IsNullOrEmpty(txtToDateSearch.Text))
                {
                    objML_SanitizationReportSearch.ReportType = ML_Common.GetDropDownValue(ddlReportTypeSearch, true);
                    objML_SanitizationReportSearch.TagStatus  = null;

                    DateTime FromDateSearch = ML_Common.ToDateTimeSafe(txtFromDateSearch.Text);
                    DateTime ToDateSearch   = ML_Common.ToDateTimeSafe(txtToDateSearch.Text);

                    var FromTimeSearch = TimeSpan.Parse("00:00:00");
                    var FromFullDt     = FromDateSearch + FromTimeSearch; // 2010-06-26 01:16:50

                    var ToTimeSearch = TimeSpan.Parse("23:59:59");
                    var ToFullDt     = ToDateSearch + ToTimeSearch; // 2010-06-26 01:16:50

                    var From24Hour = FromFullDt.ToString("MM/dd/yyyy HH:mm:ss", CultureInfo.CurrentCulture);
                    var To24Hour   = ToFullDt.ToString("MM/dd/yyyy HH:mm:ss", CultureInfo.CurrentCulture);


                    objML_SanitizationReportSearch.FromDate = ML_Common.ToDateTimeSafeNull(From24Hour.ToString());
                    objML_SanitizationReportSearch.ToDate   = ML_Common.ToDateTimeSafeNull(To24Hour.ToString());

                    DtList = BindGridViewBySearch(objML_SanitizationReportSearch);
                }


                if (DtList != null)
                {
                    //DtList = (DataTable)ViewState["grdSanitizationReportTM"];
                    if (DtList.Rows.Count > 0)
                    {
                        grdSanitizationReport.DataSource = DtList;
                        grdSanitizationReport.DataBind();
                    }
                    else
                    {
                        DtList.Rows.Add(DtList.NewRow());
                        grdSanitizationReport.DataSource = DtList;
                        grdSanitizationReport.DataBind();

                        int TotalColumns = grdSanitizationReport.Rows[0].Cells.Count;
                        grdSanitizationReport.Rows[0].Cells.Clear();
                        grdSanitizationReport.Rows[0].Cells.Add(new TableCell());
                        grdSanitizationReport.Rows[0].Cells[0].ColumnSpan = TotalColumns;
                        grdSanitizationReport.Rows[0].Cells[0].Text       = "No Record Found";
                    }
                    UpdatePanelGrid.Update();
                }
            }
            catch (Exception ex)
            {
                Exception exc = ex;
            }
        }
Esempio n. 24
0
 protected void UpdateGrid()
 {
     LoadColumns();
     UpdatePanelGrid.Update();
 }
Esempio n. 25
0
        protected void btnOkGeneral_Click(object sender, EventArgs e)
        {
            var data = new List <DTO.ConfigEntity>();

            foreach (GridViewRow gr in gvGeneral.Rows)
            {
                var lblIdGvGeneral    = (Label)gr.FindControl("lblIdGvGeneral");
                var lblValueGvGeneral = (Label)gr.FindControl("lblValueGvGeneral");
                var txtYear           = (TextBox)gr.FindControl("txtYearValue");
                var ddlPicForLicense  = (DropDownList)gr.FindControl("ddlConfigPicForLicense");
                if (lblValueGvGeneral.Text == "Y" || lblValueGvGeneral.Text == "N")
                {
                    if (((CheckBox)gr.FindControl("chkSpecifiedValueGeneral")).Checked == true)
                    {
                        data.Add(new DTO.ConfigEntity
                        {
                            Id    = lblIdGvGeneral.Text,
                            Value = "Y"
                        });
                    }
                    else if (((CheckBox)gr.FindControl("chkSpecifiedValueGeneral")).Checked == false)
                    {
                        data.Add(new DTO.ConfigEntity
                        {
                            Id    = lblIdGvGeneral.Text,
                            Value = "N"
                        });
                    }
                }
                else if (lblIdGvGeneral.Text == "13")
                {
                    data.Add(new DTO.ConfigEntity {
                        Id = lblIdGvGeneral.Text, Value = ddlPicForLicense.SelectedValue, GROUP_CODE = "DT001"
                    });
                }
                else if (lblValueGvGeneral.Text != "Y" && lblValueGvGeneral.Text != "N")
                {
                    data.Add(new DTO.ConfigEntity
                    {
                        Id         = lblIdGvGeneral.Text,
                        Value      = txtYear.Text,
                        GROUP_CODE = "RC001"
                    });
                }
            }

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

                var res = biz.UpdateConfigApproveMember(data);

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

                    UCModalError.ShowMessageError = res.ErrorMsg;
                    UCModalError.ShowModalError();
                }
                else
                {
                    UCModalSuccess.ShowMessageSuccess = "บันทึกข้อมูลเรียบร้อย";
                    UCModalSuccess.ShowModalSuccess();
                    BindDataInGridView();
                    UpdatePanelGrid.Update();
                }
            }
        }