Exemplo n.º 1
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(
        }