示例#1
0
 private void nav_TBarClick(object sender, ToolBarButtonClickEventArgs e)
 {
     if (e.Button.Equals(nav.cmd_add))
     {
         if (vs.Rows.Count == 1 || (int)vs.Rows[vs.Rows.Count - 1].UserData + "" != "2")
         {
             nav.ToolBar_Click(e);
         }
         return;
     }
     if (e.Button.Equals(nav.cmd_save))
     {
         Boolean save = false;
         for (int i = 1; i < vs.Rows.Count; i++)
         {
             if (vs.Rows[i].UserData + "" == "2")
             {
                 save = true;
                 break;
             }
         }
         for (int i = 1; i < vs.Rows.Count; i++)
         {
             if (vs.Rows[i]["COL_NO"] + "" == "")
             {
                 for (int j = 1; j <= 12; j++)
                 {
                     int count = T_String.IsNullTo0(T_String.GetDataFromSQL("Count(*)"
                                                                            , "FILD05A", "COL_NO=N'COL_" + j.ToString("00") + "'"));
                     if (count <= 0)
                     {
                         vs.Rows[i]["COL_NO"] = "COL_" + j.ToString("00");
                         break;
                     }
                 }
             }
         }
         nav.ToolBar_Click(e);
         if (save)
         {
             PublicFunction.SQL_Execute("delete from FILD06A ");
             Func.RecordSet rs = new Func.RecordSet("Select * From FILD05A order by MON_QT DESC", PublicFunction.C_con);
             for (int i = 0; i < rs.rows; i++)
             {
                 PublicFunction.SQL_Execute("update FILD05A set COL_NO=N'COL_" + (i + 1).ToString("00") + "' where MON_QT=" + rs.record(i, "MON_QT"));
             }
         }
         nav.Show_VS("1=1 ORDER BY MON_QT");
         return;
     }
     if (e.Button.Equals(nav.cmd_delete))
     {
         nav.ToolBar_Click(e);
         PublicFunction.SQL_Execute("delete from FILD06A ");
         Func.RecordSet rs = new Func.RecordSet("Select * From FILD05A order by MON_QT DESC", PublicFunction.C_con);
         for (int i = 0; i < rs.rows; i++)
         {
             PublicFunction.SQL_Execute("update FILD05A set COL_NO=N'COL_" + (i + 1).ToString("00") + "' where MON_QT=" + rs.record(i, "MON_QT"));
         }
         return;
     }
     nav.ToolBar_Click(e);
 }
示例#2
0
 private void nav1_TBarClick(object sender, ToolBarButtonClickEventArgs e)
 {
     if (e.Button.Equals(nav1.cmd_add))
     {
         nav1.ToolBar_Click(e);
         vs1.Rows[vs1.Rows.Count - 1]["STY_NO"] = vs.Rows[vs.Row]["STY_NO"];
         return;
     }
     if (e.Button.Equals(nav1.cmd_save))
     {
         Boolean a = true;
         for (int i = 1; i < vs1.Rows.Count; i++)
         {
             if (vs1.Rows[i]["SEQ_NO"] + "" != i.ToString("000"))
             {
                 a = false;
             }
         }
         for (int i = 1; i < vs1.Rows.Count; i++)
         {
             vs1.Rows[i]["SEQ_NO"] = i.ToString("000");
             if (T_String.IsNullTo0(vs1.Rows[i].UserData + "") != 2)
             {
                 if (T_String.IsNullTo0(vs1.Rows[i].UserData + "") == 1)
                 {
                     vs1.Rows[i]["LST_NM"] = PublicFunction.A_UserID;
                     vs1.Rows[i]["LST_DT"] = T_String.GetDate().ToString("yyyy/MM/dd HH:mm");
                 }
                 if (!a)
                 {
                     vs1.Rows[i].UserData  = 1;
                     vs1.Rows[i]["LST_NM"] = PublicFunction.A_UserID;
                     vs1.Rows[i]["LST_DT"] = T_String.GetDate().ToString("yyyy/MM/dd HH:mm");
                 }
             }
             else
             {
                 vs1.Rows[i]["BLT_NM"] = vs1.Rows[i]["LST_NM"] = PublicFunction.A_UserID;
                 vs1.Rows[i]["LST_DT"] = vs1.Rows[i]["BLT_DT"] = T_String.GetDate().ToString("yyyy/MM/dd HH:mm");
             }
         }
         nav1.ToolBar_Click(e);
     }
     if (e.Button.Equals(nav1.cmd_delete))
     {
         nav1.ToolBar_Click(e);
         for (int i = 1; i < vs1.Rows.Count; i++)
         {
             vs1.Rows[i]["SEQ_NO"] = i.ToString("000");
             if (T_String.IsNullTo0(vs1.Rows[i].UserData + "") != 2)
             {
                 vs1.Rows[i].UserData  = 1;
                 vs1.Rows[i]["LST_NM"] = PublicFunction.A_UserID;
                 vs1.Rows[i]["LST_DT"] = T_String.GetDate().ToString("yyyy/MM/dd HH:mm");
             }
             else
             {
                 vs1.Rows[i]["BLT_NM"] = vs1.Rows[i]["LST_NM"] = PublicFunction.A_UserID;
                 vs1.Rows[i]["LST_DT"] = vs1.Rows[i]["BLT_DT"] = T_String.GetDate().ToString("yyyy/MM/dd HH:mm");
             }
         }
         nav1.ToolBar_Click(new ToolBarButtonClickEventArgs(nav1.cmd_save));
         return;
     }
     if (e.Button.Equals(nav1.cmd_refresh))
     {
         Show_vs1();
         return;
     }
     nav1.ToolBar_Click(e);
 }
示例#3
0
        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);
        }
示例#4
0
 private void nav_TBarClick(object sender, ToolBarButtonClickEventArgs e)
 {
     nav.ToolBar_Click(e);
 }