public void Check_left(string ORG_NAME) { string cmb_ORG_Value = ""; OPM_BL BL = new OPM_BL(); cmb_ORG_Value= BL.GetValue_DDLSMMORG_LV3(ORG_NAME); Session["dtleft"] = GetDataToLeft(cmb_ORG_Value); Session["dtright"] = GetDataToRight(cmb_ORG_Value); }
public void SAVE_TREE(string PATTERN_CODE) { string NODE_CODE = string.Empty; if (string.IsNullOrEmpty(PATTERN_CODE)) { if (dt_Show_Tree.Rows.Count > 0) { PATTERN_CODE = Request.QueryString["PATTERN_CODE"]; } } for (int i = 0; i <= dt_default_Tree.Rows.Count - 1; i++) { NODE_CODE += dt_default_Tree.Rows[i]["NODE_CODE"].ToString() + ","; } if (dt_default_Tree.Rows.Count > 0) { NODE_CODE = NODE_CODE.Substring(0, NODE_CODE.Length - 1); } string sql = "delete from CTLT_TREE_PATTERN where NODE_CODE in (" + NODE_CODE + ")"; OPM_BL BL = new OPM_BL(); if (!string.IsNullOrEmpty(NODE_CODE)) { Int16 t = Convert.ToInt16(BL.SQL_TREE_PATTERN(sql)); } for (int i = 0; i <= dt_Show_Tree.Rows.Count - 1; i++) { sql = "insert into CTLT_TREE_PATTERN (PATTERN_CODE,NODE_CODE,ITEM_CODE,PARENT_NODE_CODE,USER_ID,LAST_DATE,MA_FLAG,PRINT_FLAG,QUERY_FLAG) values "; sql += "('" + PATTERN_CODE + "','" + dt_Show_Tree.Rows[i]["NODE_CODE"].ToString() + "','" + dt_Show_Tree.Rows[i]["ITEM_CODE"].ToString() + "',"; sql += "'" + dt_Show_Tree.Rows[i]["PARENT_NODE_CODE"].ToString() + "','" + OPM_BL._Username + "',GETDATE(),'Y','Y','Y')"; Int16 t2 = Convert.ToInt16(BL.SQL_TREE_PATTERN(sql)); } }
protected void BindData() { string _PATTERN_CODE = string.Empty; if (Request.QueryString["PATTERN_CODE"] != null && Request.QueryString["PATTERN_CODE"] != "-1") { _PATTERN_CODE = Request.QueryString["PATTERN_CODE"]; } if (dt_Show_Tree == null) { string SQL = "SELECT CTLT_TREE_PATTERN.NODE_CODE, CTLT_ITEM.ITEM_TYPE, CTLT_TREE_PATTERN.ITEM_CODE, CTLT_ITEM.ITEM_NAME,"; SQL += "CTLT_TREE_PATTERN.PARENT_NODE_CODE FROM CTLT_TREE_PATTERN INNER JOIN CTLT_ITEM ON CTLT_TREE_PATTERN.ITEM_CODE = CTLT_ITEM.ITEM_CODE"; SQL += " WHERE (CTLT_TREE_PATTERN.PATTERN_CODE = '" + _PATTERN_CODE + "')"; OPM_BL OP = new OPM_BL(); DataTable dt = OP.GET_PATTERN(SQL); ViewState["Show_Tree"] = dt; ViewState["dt_default_Tree"] = dt; } ASPxTreeList1.DataSource = dt_Show_Tree; ASPxTreeList1.DataBind(); }
public void CountDate_chkDEL(string nodecode) { string _Sub_nodecode = string.Empty; string PATTERN_CODE = Request.QueryString["PATTERN_CODE"]; DataTable dt = new DataTable(); SqlParameter[] param = new SqlParameter[1]; string SQL = "SELECT CTLT_TREE_PATTERN.NODE_CODE, CTLT_ITEM.ITEM_TYPE, CTLT_TREE_PATTERN.ITEM_CODE, CTLT_ITEM.ITEM_NAME, "; SQL +="CTLT_TREE_PATTERN.PARENT_NODE_CODE FROM CTLT_TREE_PATTERN INNER JOIN CTLT_ITEM ON CTLT_TREE_PATTERN.ITEM_CODE = CTLT_ITEM.ITEM_CODE"; SQL +=" WHERE (CTLT_TREE_PATTERN.PATTERN_CODE = @PATTERN_CODE)"; param[0] = OPM_BL.setParameter("@PATTERN_CODE", SqlDbType.VarChar, PATTERN_CODE); dt = OPM_BL.GetDatatable(SQL, param); dt.DefaultView.RowFilter = " PARENT_NODE_CODE = '" + nodecode + "'"; for (int i = 0; i <= dt.DefaultView.Count - 1; i++) { if (dt.DefaultView[i]["ITEM_TYPE"].ToString() == "M") { CountDate_chkDEL(dt.DefaultView[i]["NODE_CODE"].ToString()); } _Sub_nodecode += dt.DefaultView[i]["NODE_CODE"].ToString() + ","; } _Sub_nodecode = _Sub_nodecode.Substring(0, _Sub_nodecode.Length - 1); param = new SqlParameter[1]; string _SQL = "DELETE FROM CTLT_TREE_PATTERN WHERE NODE_CODE in (" + _Sub_nodecode + ")"; OPM_BL BL = new OPM_BL(); string Del_chk = Convert.ToString(BL.SQL_TREE_PATTERN(_SQL)); //param[0] = OPM_BL.setParameter("@nodecode", SqlDbType.VarChar, _Sub_nodecode); //string _ret = OPM_BL.ExecuteNoneQuery(_SQL, param); //_chk_Delete = _ret; }
protected void btnSave_Click1(object sender, EventArgs e) { try { bool result = false; SqlConnection conn = null; conn = new SqlConnection(OPM_BL.DefaultConnectionString); SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandText = string.Format("delete from ODS_PROGRAM_ROLE where SYS_CODE='{0}' and ROLE_ID='{1}'", ctlSYS_CODE.Text, txtRole_ID.Text); cmd.CommandType = CommandType.Text; if (conn.State == ConnectionState.Closed) conn.Open(); result = Convert.ToBoolean(cmd.ExecuteNonQuery()); ASPxGridView grid = sender as ASPxGridView; for (int i = 0; i < viewODS_SYSTEM_ROLE_PROGRAM_View.VisibleRowCount; i++) { string fieldValues = viewODS_SYSTEM_ROLE_PROGRAM_View.GetRowValues(i, "PRG_ID").ToString();// new string[] { "PRG_ID" } ASPxCheckBox chkVIEW_FLAG = viewODS_SYSTEM_ROLE_PROGRAM_View.FindRowCellTemplateControl (i, (GridViewDataColumn)viewODS_SYSTEM_ROLE_PROGRAM_View.Columns["VIEW_SHOW"], "chkVIEW_FLAG") as ASPxCheckBox; ASPxCheckBox chkINSERT_FLAG = viewODS_SYSTEM_ROLE_PROGRAM_View.FindRowCellTemplateControl (i, (GridViewDataColumn)viewODS_SYSTEM_ROLE_PROGRAM_View.Columns["INSERT_SHOW"], "chkINSERT_FLAG") as ASPxCheckBox; ASPxCheckBox chkUPDATE_FLAG = viewODS_SYSTEM_ROLE_PROGRAM_View.FindRowCellTemplateControl (i, (GridViewDataColumn)viewODS_SYSTEM_ROLE_PROGRAM_View.Columns["UPDATE_SHOW"], "chkUPDATE_FLAG") as ASPxCheckBox; ASPxCheckBox chkDELETE_FLAG = viewODS_SYSTEM_ROLE_PROGRAM_View.FindRowCellTemplateControl (i, (GridViewDataColumn)viewODS_SYSTEM_ROLE_PROGRAM_View.Columns["DELETE_SHOW"], "chkDELETE_FLAG") as ASPxCheckBox; ASPxCheckBox chkPRINT_FLAG = viewODS_SYSTEM_ROLE_PROGRAM_View.FindRowCellTemplateControl (i, (GridViewDataColumn)viewODS_SYSTEM_ROLE_PROGRAM_View.Columns["PRINT_SHOW"], "chkPRINT_FLAG") as ASPxCheckBox; ASPxCheckBox chkVERIFY_FLAG = viewODS_SYSTEM_ROLE_PROGRAM_View.FindRowCellTemplateControl (i, (GridViewDataColumn)viewODS_SYSTEM_ROLE_PROGRAM_View.Columns["VERIFY_SHOW"], "chkVERIFY_FLAG") as ASPxCheckBox; ASPxCheckBox chkAUTO_VERIFY_FLAG = viewODS_SYSTEM_ROLE_PROGRAM_View.FindRowCellTemplateControl (i, (GridViewDataColumn)viewODS_SYSTEM_ROLE_PROGRAM_View.Columns["AUTO_VERIFY_FLAG_SHOW"], "chkAUTO_VERIFY_FLAG") as ASPxCheckBox; ASPxCheckBox chkAPPROVE_FLAG = viewODS_SYSTEM_ROLE_PROGRAM_View.FindRowCellTemplateControl (i, (GridViewDataColumn)viewODS_SYSTEM_ROLE_PROGRAM_View.Columns["APPROVE_SHOW"], "chkAPPROVE_FLAG") as ASPxCheckBox; ASPxCheckBox chkAUTO_APPROVE_FLAG = viewODS_SYSTEM_ROLE_PROGRAM_View.FindRowCellTemplateControl (i, (GridViewDataColumn)viewODS_SYSTEM_ROLE_PROGRAM_View.Columns["AUTO_APPROVE_SHOW"], "chkAUTO_APPROVE_FLAG") as ASPxCheckBox; ASPxCheckBox chkPROCESS_FLAG = viewODS_SYSTEM_ROLE_PROGRAM_View.FindRowCellTemplateControl (i, (GridViewDataColumn)viewODS_SYSTEM_ROLE_PROGRAM_View.Columns["PROCESS_SHOW"], "chkPROCESS_FLAG") as ASPxCheckBox; RadioButton RadPERSONAL_SCOPE = viewODS_SYSTEM_ROLE_PROGRAM_View.FindRowCellTemplateControl (i, (GridViewDataColumn)viewODS_SYSTEM_ROLE_PROGRAM_View.Columns["PERSONAL_SCOPE"], "RadPERSONAL_SCOPE") as RadioButton; RadioButton RadDEPT_SCOPE = viewODS_SYSTEM_ROLE_PROGRAM_View.FindRowCellTemplateControl (i, (GridViewDataColumn)viewODS_SYSTEM_ROLE_PROGRAM_View.Columns["DEPT_SCOPE"], "RadDEPT_SCOPE") as RadioButton; RadioButton RadALL_SCOPE = viewODS_SYSTEM_ROLE_PROGRAM_View.FindRowCellTemplateControl (i, (GridViewDataColumn)viewODS_SYSTEM_ROLE_PROGRAM_View.Columns["ALL_SCOPE"], "RadALL_SCOPE") as RadioButton; //dsODS_PROGRAM_View.UpdateParameters.Clear(); //dsODS_PROGRAM_View.UpdateParameters.Add("PRG_ID", fieldValues+ ""); //dsODS_PROGRAM_View.UpdateParameters.Add("SYS_CODE", ctlSYS_CODE.Text); //dsODS_PROGRAM_View.UpdateParameters.Add("ROLE_ID", txtRole_ID.Text + ""); //dsODS_PROGRAM_View.UpdateParameters.Add("ROLE_DESC", txtRole_Name.Text + ""); //dsODS_PROGRAM_View.UpdateParameters.Add("VIEW_FLAG", chkVIEW_FLAG==null||chkVIEW_FLAG.Checked==false ? "0" : "1"); //dsODS_PROGRAM_View.UpdateParameters.Add("INSERT_FLAG", chkINSERT_FLAG==null||chkINSERT_FLAG.Checked==false ? "0" : "1"); //dsODS_PROGRAM_View.UpdateParameters.Add("UPDATE_FLAG", chkUPDATE_FLAG==null||chkUPDATE_FLAG.Checked==false ? "0" : "1"); //dsODS_PROGRAM_View.UpdateParameters.Add("DELETE_FLAG", chkDELETE_FLAG==null||chkDELETE_FLAG.Checked==false ? "0" : "1"); //dsODS_PROGRAM_View.UpdateParameters.Add("PRINT_FLAG", chkPRINT_FLAG==null||chkPRINT_FLAG.Checked==false ? "0" : "1"); //dsODS_PROGRAM_View.UpdateParameters.Add("VERIFY_FLAG", chkVERIFY_FLAG==null||chkVERIFY_FLAG.Checked==false ? "0" : "1"); //dsODS_PROGRAM_View.UpdateParameters.Add("APPROVE_FLAG", chkAPPROVE_FLAG==null||chkAPPROVE_FLAG.Checked==false ? "0" : "1"); //dsODS_PROGRAM_View.UpdateParameters.Add("PROCESS_FLAG", chkPROCESS_FLAG==null||chkPROCESS_FLAG.Checked==false ? "0" : "1"); //dsODS_PROGRAM_View.UpdateParameters.Add("PERSONAL_SCOPE",RadPERSONAL_SCOPE==null||RadPERSONAL_SCOPE.Checked==false ? "0" : "1"); //dsODS_PROGRAM_View.UpdateParameters.Add("DEPT_SCOPE",RadDEPT_SCOPE==null||RadDEPT_SCOPE.Checked==false ? "0" : "1"); //dsODS_PROGRAM_View.UpdateParameters.Add("ALL_SCOPE", RadALL_SCOPE==null||RadALL_SCOPE.Checked==false ? "0" : "1"); //dsODS_PROGRAM_View.UpdateParameters.Add("ACTIVE_STATUS", "Y"); //dsODS_PROGRAM_View.UpdateParameters.Add("CREATE_USER_ID", "CREATE_USER_ID"); //dsODS_PROGRAM_View.UpdateParameters.Add("CREATE_TIME", System.Data.DbType.DateTime, DateTime.Now.ToString()); //dsODS_PROGRAM_View.UpdateParameters.Add("UPD_USER_ID", "UPD_USER_ID"); //dsODS_PROGRAM_View.UpdateParameters.Add("UPD_DATE", System.Data.DbType.DateTime, DateTime.Now.ToString()); result = false; //SqlConnection conn = null; //using (TransactionScope scope = new TransactionScope()) //{ //try //{ conn = new SqlConnection(OPM_BL.DefaultConnectionString); cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandText = "sp_ODS_PROGRAM_ROLE"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("PRG_ID", fieldValues + ""); cmd.Parameters.AddWithValue("SYS_CODE", ctlSYS_CODE.Text); cmd.Parameters.AddWithValue("ROLE_ID", txtRole_ID.Text + ""); cmd.Parameters.AddWithValue("ROLE_DESC", txtRole_Name.Text + ""); cmd.Parameters.AddWithValue("VIEW_FLAG", chkVIEW_FLAG != null && chkVIEW_FLAG.Checked ? "1" : "0"); cmd.Parameters.AddWithValue("INSERT_FLAG", chkINSERT_FLAG != null && chkINSERT_FLAG.Checked ? "1" : "0"); cmd.Parameters.AddWithValue("UPDATE_FLAG", chkUPDATE_FLAG != null && chkUPDATE_FLAG.Checked ? "1" : "0"); cmd.Parameters.AddWithValue("DELETE_FLAG", chkDELETE_FLAG != null && chkDELETE_FLAG.Checked ? "1" : "0"); cmd.Parameters.AddWithValue("PRINT_FLAG", chkPRINT_FLAG != null && chkPRINT_FLAG.Checked ? "1" : "0"); cmd.Parameters.AddWithValue("VERIFY_FLAG", chkVERIFY_FLAG != null && chkVERIFY_FLAG.Checked ? "1" : "0"); cmd.Parameters.AddWithValue("AUTO_VERIFY_FLAG", chkAUTO_VERIFY_FLAG != null && chkAUTO_VERIFY_FLAG.Checked ? "1" : "0"); cmd.Parameters.AddWithValue("APPROVE_FLAG", chkAPPROVE_FLAG != null && chkAPPROVE_FLAG.Checked ? "1" : "0"); cmd.Parameters.AddWithValue("AUTO_APPROVE_FLAG", chkAUTO_APPROVE_FLAG != null && chkAUTO_APPROVE_FLAG.Checked ? "1" : "0"); cmd.Parameters.AddWithValue("PROCESS_FLAG", chkPROCESS_FLAG != null && chkPROCESS_FLAG.Checked ? "1" : "0"); cmd.Parameters.AddWithValue("PERSONAL_SCOPE", RadPERSONAL_SCOPE != null && RadPERSONAL_SCOPE.Checked ? "1" : "0"); cmd.Parameters.AddWithValue("DEPT_SCOPE", RadDEPT_SCOPE != null && RadDEPT_SCOPE.Checked ? "1" : "0"); cmd.Parameters.AddWithValue("ALL_SCOPE", RadALL_SCOPE != null && RadALL_SCOPE.Checked ? "1" : "0"); cmd.Parameters.AddWithValue("ACTIVE_STATUS", "Y"); OPM_BL PL = new OPM_BL(); DataTable dt = new DataTable(); dt = PL.GetCrt_UT(ctlSYS_CODE.Text, txtRole_ID.Text); if (dt.Rows.Count > 0) { cmd.Parameters.AddWithValue("CREATE_USER_ID", dt.Rows[0]["CREATE_USER_ID"].ToString()); cmd.Parameters.AddWithValue("CREATE_TIME", dt.Rows[0]["CREATE_TIME"]); cmd.Parameters.AddWithValue("UPD_USER_ID", OPM_BL._Username); cmd.Parameters.AddWithValue("UPD_DATE", DateTime.Now); } else { cmd.Parameters.AddWithValue("CREATE_USER_ID", OPM_BL._Username); cmd.Parameters.AddWithValue("CREATE_TIME", DateTime.Now); cmd.Parameters.AddWithValue("UPD_USER_ID", null); cmd.Parameters.AddWithValue("UPD_DATE", null); } if (conn.State == ConnectionState.Closed) conn.Open(); result = Convert.ToBoolean(cmd.ExecuteNonQuery()); //scope.Complete(); //JS = "alert('บันทึก');"; //} //catch (Exception ex) //{ //} //finally //{ // conn.Close(); // scope.Dispose(); //} // } } } catch (Exception ex) { } //LogFileEng.SaveActionTransLog("ODS_UT0402", "SAVE", "SAVE NOT SUCCESS SYS_CODE : " + ctlSYS_CODE.Text.Trim(), "ODS_SYSTEM", "", "", Request); //try //{ // bool IS_BASIC = false; // if (viewODS_SYSTEM_ROLE_ListView.FocusedRowIndex != -1) // { // role_id = viewODS_SYSTEM_ROLE_ListView.GetDataRow(viewODS_SYSTEM_ROLE_ListView.FocusedRowIndex)["ROLE_ID"] + ""; // role_name = viewODS_SYSTEM_ROLE_ListView.GetDataRow(viewODS_SYSTEM_ROLE_ListView.FocusedRowIndex)["ROLE_NAME"] + ""; // IS_BASIC = viewODS_SYSTEM_ROLE_ListView.GetDataRow(viewODS_SYSTEM_ROLE_ListView.FocusedRowIndex)["IS_BASIC"] + "" == "" ? false : Convert.ToBoolean(viewODS_SYSTEM_ROLE_ListView.GetDataRow(viewODS_SYSTEM_ROLE_ListView.FocusedRowIndex)["IS_BASIC"] + ""); // } // dsODS_PROGRAM_View.SelectParameters.Clear(); // dsODS_PROGRAM_View.SelectParameters.Add("ROLE_ID", role_id); // dsODS_PROGRAM_View.SelectParameters.Add("SYS_CODE", System.Data.DbType.String, inputSYS_CODE); // viewODS_SYSTEM_ROLE_PROGRAM_View.DataBind(); // JS = string.Format("document.getElementById('txtRole_ID').value='{0}';", role_id); // mp.RunJS(JS, this); //} //catch (Exception) //{ //} currentTab = 2; }
protected void viewODS_SYSTEM_ROLE_ListView_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { try { dsODS_SYSTEM_ROLE_ListView.UpdateParameters.Clear(); dsODS_SYSTEM_ROLE_ListView.UpdateParameters.Add("SYS_CODE", ctlSYS_CODE.Text); dsODS_SYSTEM_ROLE_ListView.UpdateParameters.Add("ROLE_ID", e.NewValues["ROLE_ID"] + ""); dsODS_SYSTEM_ROLE_ListView.UpdateParameters.Add("ROLE_ID_DEL", e.OldValues["ROLE_ID"] + ""); dsODS_SYSTEM_ROLE_ListView.UpdateParameters.Add("ROLE_NAME", e.NewValues["ROLE_NAME"] + ""); dsODS_SYSTEM_ROLE_ListView.UpdateParameters.Add("IS_BASIC", System.Data.DbType.Boolean, e.NewValues["IS_BASIC"] + ""); dsODS_SYSTEM_ROLE_ListView.UpdateParameters.Add("ACTIVE_STATUS", "Y"); OPM_BL OD = new OPM_BL(); DataTable dt = OD.GetSysRole_UT(ctlSYS_CODE.Text, txtRole_ID.Text); string us = dt.Rows[0]["CREATE_USER_ID"].ToString(); string t = dt.Rows[0]["CREATE_TIME"].ToString(); if (dt.Rows.Count > 0) { dsODS_SYSTEM_ROLE_ListView.UpdateParameters.Add("CREATE_USER_ID", dt.Rows[0]["CREATE_USER_ID"].ToString()); dsODS_SYSTEM_ROLE_ListView.UpdateParameters.Add("CREATE_TIME", System.Data.DbType.DateTime, dt.Rows[0]["CREATE_TIME"].ToString()); dsODS_SYSTEM_ROLE_ListView.UpdateParameters.Add("UPD_USER_ID", OPM_BL._Username); dsODS_SYSTEM_ROLE_ListView.UpdateParameters.Add("UPD_DATE", System.Data.DbType.DateTime, DateTime.Now.ToString()); } else { dsODS_SYSTEM_ROLE_ListView.UpdateParameters.Add("CREATE_USER_ID", OPM_BL._Username); dsODS_SYSTEM_ROLE_ListView.UpdateParameters.Add("CREATE_TIME", System.Data.DbType.DateTime, DateTime.Now.ToString()); dsODS_SYSTEM_ROLE_ListView.UpdateParameters.Add("UPD_USER_ID", OPM_BL._Username); dsODS_SYSTEM_ROLE_ListView.UpdateParameters.Add("UPD_DATE", System.Data.DbType.DateTime, DateTime.Now.ToString()); } string TARGET_URL = "ODS_SYSTEM_DetailView.aspx?SYS_CODE=" + inputSYS_CODE + "&Active=2"; if (Page.IsCallback) DevExpress.Web.ASPxClasses.ASPxWebControl.RedirectOnCallback(TARGET_URL); else Response.Redirect(TARGET_URL); } catch (Exception ex) { } }
protected void BindData_view(string Role_ID) { //string ROLE_ID = string.Empty; string SYS_CODE = string.Empty; if (Request.QueryString["SYS_CODE"] != null && Request.QueryString["SYS_CODE"] != "-1") { SYS_CODE = Request.QueryString["SYS_CODE"].ToString(); } //if (dt_Show_Tree == null) //{ string SQL = "select distinct PRG.PRG_ID,PRG.SYS_CODE,PRG.PRG_NAME,"; SQL += "CASE WHEN PRG.VIEW_FLAG is not null THEN PRG.VIEW_FLAG ELSE '0' END as VIEW_SHOW,"; SQL += "CASE WHEN PRG.INSERT_FLAG is not null THEN PRG.INSERT_FLAG ELSE '0' END as INSERT_SHOW,"; SQL += "CASE WHEN PRG.UPDATE_FLAG is not null THEN PRG.UPDATE_FLAG ELSE '0' END as UPDATE_SHOW,"; SQL += "CASE WHEN PRG.DELETE_FLAG is not null THEN PRG.DELETE_FLAG ELSE '0' END as DELETE_SHOW,"; SQL += "CASE WHEN PRG.PRINT_FLAG is not null THEN PRG.PRINT_FLAG ELSE '0' END as PRINT_SHOW,"; SQL += "CASE WHEN PRG.VERIFY_FLAG is not null THEN PRG.VERIFY_FLAG ELSE '0' END as VERIFY_SHOW,"; SQL += "CASE WHEN PRG.AUTO_VERIFY_FLAG is not null THEN PRG.AUTO_VERIFY_FLAG ELSE '0' END as AUTO_VERIFY_FLAG_SHOW,"; SQL += "CASE WHEN PRG.APPROVE_FLAG is not null THEN PRG.APPROVE_FLAG ELSE '0' END as APPROVE_SHOW,"; SQL += "CASE WHEN PRG.AUTO_APPROVE_FLAG is not null THEN PRG.AUTO_APPROVE_FLAG ELSE '0' END as AUTO_APPROVE_SHOW,"; SQL += "CASE WHEN PRG.PROCESS_FLAG is not null THEN PRG.PROCESS_FLAG ELSE '0' END as PROCESS_SHOW,"; SQL += "CASE WHEN R.VIEW_FLAG is not null THEN R.VIEW_FLAG ELSE '0' END as VIEW_FLAG,"; SQL += "CASE WHEN R.INSERT_FLAG is not null THEN R.INSERT_FLAG ELSE '0' END as INSERT_FLAG,"; SQL += "CASE WHEN R.UPDATE_FLAG is not null THEN R.UPDATE_FLAG ELSE '0' END as UPDATE_FLAG,"; SQL += "CASE WHEN R.DELETE_FLAG is not null THEN R.DELETE_FLAG ELSE '0' END as DELETE_FLAG,"; SQL += "CASE WHEN R.PRINT_FLAG is not null THEN R.PRINT_FLAG ELSE '0' END as PRINT_FLAG,"; SQL += "CASE WHEN R.VERIFY_FLAG is not null THEN R.VERIFY_FLAG ELSE '0' END as VERIFY_FLAG,"; SQL += "CASE WHEN R.AUTO_VERIFY_FLAG is not null THEN R.AUTO_VERIFY_FLAG ELSE '0' END as AUTO_VERIFY_FLAG,"; SQL += "CASE WHEN R.APPROVE_FLAG is not null THEN R.APPROVE_FLAG ELSE '0' END as APPROVE_FLAG,"; SQL += "CASE WHEN R.AUTO_APPROVE_FLAG is not null THEN R.AUTO_APPROVE_FLAG ELSE '0' END as AUTO_APPROVE_FLAG,"; SQL += "CASE WHEN R.PROCESS_FLAG is not null THEN R.PROCESS_FLAG ELSE '0' END as PROCESS_FLAG,"; SQL += "CASE WHEN R.DEPT_SCOPE is null AND R.ALL_SCOPE is null THEN 1 WHEN R.PERSONAL_SCOPE is not null THEN 1 ELSE 0 END as PERSONAL_SCOPE,"; SQL += "CASE WHEN R.DEPT_SCOPE is not null THEN R.DEPT_SCOPE ELSE '0' END as DEPT_SCOPE,"; SQL += "CASE WHEN R.ALL_SCOPE is not null THEN R.ALL_SCOPE ELSE '0' END as ALL_SCOPE,"; SQL += "CASE WHEN PRG.SCOPE_FLAG is not null THEN PRG.SCOPE_FLAG ELSE '0' END as SCOPE_SHOW"; SQL += "from ods_program PRG "; SQL += "left join ODS_PROGRAM_ROLE R ON PRG.PRG_ID=R.PRG_ID AND R.ROLE_ID='" + Role_ID + "'"; SQL += "WHERE PRG.SYS_CODE='" + SYS_CODE + "'"; OPM_BL OP = new OPM_BL(); DataTable dt = OP.GET_PROGRAM_ROLE(SQL); viewODS_SYSTEM_ROLE_PROGRAM_View.DataSource = dt; viewODS_SYSTEM_ROLE_PROGRAM_View.DataBind(); }
protected void viewODS_SYSTEM_ROLE_ListView_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { try { OPM_BL OD = new OPM_BL(); DataTable dt = OD.Check_USROLE(OPM_BL._Username,ctlSYS_CODE.Text, e.Values["ROLE_ID"].ToString()); if (dt.Rows.Count > 0) { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "alert", "alert('ไม่สามารถลบได้');", true); return; } dsODS_SYSTEM_ROLE_ListView.DeleteParameters.Clear(); dsODS_SYSTEM_ROLE_ListView.DeleteParameters.Add("SYS_CODE", ctlSYS_CODE.Text); dsODS_SYSTEM_ROLE_ListView.DeleteParameters.Add("ROLE_ID", e.Values["ROLE_ID"] + ""); viewODS_SYSTEM_ROLE_ListView.DataBind(); CountData1(); object d = OD.Del_ODS_PROGRAM_ROLE(ctlSYS_CODE.Text, e.Values["ROLE_ID"].ToString()); chkDelete = true; inputSYS_CODE = Request.QueryString["SYS_CODE"].ToString(); string url = "ODS_SYSTEM_DetailView.aspx?SYS_CODE=" + inputSYS_CODE + "&Active=2"; ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "refresh", "location.href='" + url + "';", true); } catch (Exception ex) { } }