private void Show_VS1() { if (vs.Row < 1) { return; } if (nav1.State && (int)vs.Rows[vs.Row].UserData == 2) { vs1.Rows.Count = 1; return; } if (nav1.State) { string sql; sql = "Insert Into SYS_SECURITY(GROUP_ID,MNU_ID) Select '" + vs.Rows[vs.Row]["GROUP_ID"] + "' as GROUP_ID,[ID] as MNU_ID from SYS_MENU where SEC=1 and [ID] not in (" + "select MNU_ID from SYS_SECURITY where GROUP_ID=N'" + vs.Rows[vs.Row]["GROUP_ID"] + "') and [ID] not in (Select H_ID from SYS_MENU)"; Func.Fun.ExecuteSQL(sql, PublicFunction.C_con); if (vs3.Row <= 1) { nav2.Show_VS("GROUP_ID=N'" + vs.Rows[vs.Row]["GROUP_ID"] + "' and a.MNU_ID=ID and SEC=1 order by EN"); } else { string ID = vs3.Rows[vs3.Row]["GRP_ID"] + ""; ID = getsql(ID); if (ID.Length > 1) { ID = ID.Remove(0, 1); } nav2.Show_VS("GROUP_ID=N'" + vs.Rows[vs.Row]["GROUP_ID"] + "' and a.MNU_ID=ID and SEC=1 and ID in(" + ID + ") order by EN"); } for (int i = 1; i < vs1.Rows.Count; i++) { if (vs1.Rows[i]["DEP_BT"] + "" == "True") { vs1.SetCellStyle(i, vs1.Cols["EN"].Index, vs1.Styles["DEP_ID"]); vs1.SetCellStyle(i, vs1.Cols["CH"].Index, vs1.Styles["DEP_ID"]); vs1.SetCellStyle(i, vs1.Cols["VN"].Index, vs1.Styles["DEP_ID"]); } if (vs1.Rows[i]["TYP_BT"] + "" == "True") { vs1.SetCellStyle(i, vs1.Cols["TYP"].Index, vs1.Styles["POS_BT"]); vs1.Rows[i]["TYP"] = vs1.Rows[0]["TYP"]; } } } }
/// <summary> /// 设置错误单元格 /// </summary> /// <param name="c1FlexGrid1"></param> /// <param name="errorCell"></param> public static void SetErrorCell(C1.Win.C1FlexGrid.C1FlexGrid c1FlexGrid1, List <int[]> errorCell) { if (c1FlexGrid1.Styles["ErrorCell"] == null) { C1.Win.C1FlexGrid.CellStyle errorStyle = c1FlexGrid1.Styles.Add("ErrorCell"); errorStyle.BackColor = Color.Red; } foreach (int[] item in errorCell) { c1FlexGrid1.SetCellStyle(item[0] + 1, item[1] + 1, "ErrorCell"); } }
private void CheckCols() { for (int i = 1; i < vs.Rows.Count; i++) { if (vs.Rows[i]["VAC_BT"] + "" == "True") { for (int c = 1; c < vs.Cols.Count; c++) { vs.SetCellStyle(i, c, vs.Styles["VAC_BT"]); } } } Set_w(); }
private void nav_TBarClick(object sender, ToolBarButtonClickEventArgs e) { if (e.Button.Equals(nav.cmd_refresh)) { // if(nav.wh!="") // nav.ToolBar_Click(e); // else // nav.Show_VS("DEP_ID in "+T_String.DEP_ID(this.Tag)); if (txt1.Text != vs.Cols[txt1.Tag + ""].Caption && txt1.Text != "") { textBox1_KeyDown(txt1, new System.Windows.Forms.KeyEventArgs(Keys.Enter)); } else { if (txt2.Text != vs.Cols[txt2.Tag + ""].Caption && txt2.Text != "") { textBox1_KeyDown(txt2, new System.Windows.Forms.KeyEventArgs(Keys.Enter)); } else { if (txt3.Text != vs.Cols[txt3.Tag + ""].Caption && txt3.Text != "") { textBox1_KeyDown(txt3, new System.Windows.Forms.KeyEventArgs(Keys.Enter)); } else { if (optAll.Checked == true) { nav.Show_VS("DEP_ID in " + T_String.DEP_ID(this.Tag) + " and YYY_YY=N'" + dt.Text + "' order by a.EMP_ID"); //nav.Show_VS("DEP_ID=N'"+Dep.Get_Data("DEP_ID")+"' and YYY_YY=N'"+ dt.Text+"'"); } else { if (optWorking.Checked == true) { nav.Show_VS("DEP_ID in " + T_String.DEP_ID(this.Tag) + " and YYY_YY=N'" + dt.Text + "' and (VAC_BT=0 or VAC_BT is null) order by a.EMP_ID"); } else { nav.Show_VS("DEP_ID in " + T_String.DEP_ID(this.Tag) + " and YYY_YY=N'" + dt.Text + "' and VAC_BT=1 order by a.EMP_ID"); } } // nav.Show_VS("DEP_ID in "+T_String.DEP_ID(this.Tag) +" and YYY_YY=N'"+dt.Text+"'" ); } } } for (int i = 1; i < vs.Rows.Count; i++) { if (vs.Rows[i]["VAC_BT"] + "" == "True") { for (int c = 1; c < vs.Cols.Count; c++) { vs.SetCellStyle(i, c, vs.Styles["VAC_BT"]); } } CAL(i); if (PublicFunction.GetOption("TYP_BT") == "1") //quang viet PublicFunction.CUS_ID=="50" { if (T_String.IsNullTo0(T_String.GetDataFromSQL("count(*)", "FILB09A", "EMP_ID='" + vs.Rows[i]["EMP_ID"] + "' AND YEAR(SWI_DT)=" + DateTime.Parse(dt.Value + "").Year)) > 0) { vs.Rows[i]["TYP_HIS"] = "...NatureSwitching..."; } } } return; } nav.ToolBar_Click(e); }