Exemple #1
0
    protected void up_lv_signoff_sta(int RowIndex, string com)
    {
        string ver = gv_display_Lv_signoffdata.Rows[RowIndex].Cells[1].Text;



        string   up_Name = "bruno";
        clsMySQL db      = new clsMySQL();

        String update_Lv = string.Format("UPDATE npieptra_lv_main_status " +
                                         " SET Ver_Status='{0}',UpdateName='{1}',UpdateTime=NOW(),LV_Signoff_Status_Change_Command='{2}'" +
                                         "where Ver_Name='{3}' and Ver_Status='{4}'",
                                         "Disable", up_Name, com, ver, "Enable");

        string str_eptraver_main_sta = "select * from npieptra_lv_main_Status where Ver_Name='" + ver + "'";

        try
        {
            if (db.QueryExecuteNonQuery(update_Lv) == true)
            {
                Panel_gv1.Visible = false;
                Panel_gv2.Visible = true;

                clsMySQL.DBReply dr = db.QueryDS(str_eptraver_main_sta);
                signoff_gv2.DataSource = dr.dsDataSet.Tables[0].DefaultView;
                signoff_gv2.DataBind();
                set_sta_srt("gv2");
            }
            else
            {
                lblError.Text = update_Lv + db.ToString();
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
        db.Close();
    }
    protected void all_lv_setting(string lv_sign, string keyitem, string stage, string SpeChar)
    {
        clsMySQL db = new clsMySQL();
        string insert_sign = "";
        String insert_lv = string.Format("insert into npieptra_lv_main" +
                               "(Ver_Name,EPTRA_KeyItem,EPTRA_LV_Stage,EPTRA_LV_SpecChar,EPTRA_LV)Values" +
                               "('{0}','{1}','{2}','{3}','{4}')" +
                               "ON DUPLICATE KEY UPDATE EPTRA_KeyItem='{1}',EPTRA_LV_Stage='{2}',EPTRA_LV_SpecChar='{3}',EPTRA_LV='{4}'",
                               global_Ver_Name, keyitem, stage, SpeChar, lv_sign);


        try
        {

            if (db.QueryExecuteNonQuery(insert_lv) == true)
            {

                //t += Convert.ToString(i) + ",";
                insert_sign = "true";

            }
            else
            {
                //f += Convert.ToString(i) + ",";
                insert_sign = "false";
                lblError.Text = insert_lv + db.ToString();

            }
        }
        catch (Exception ex)
        {
            lblError.Text = ex.ToString();
            throw ex;
        }


    }