Example #1
0
 //保存报表
 protected void SaveBook_Click(object sender, EventArgs e)
 {
     try
     {
         MSYS.DAL.DbOperator opt  = new MSYS.DAL.DbOperator();
         DataSet             data = opt.CreateDataSetOra("select * from HT_SYS_EXCEL_BOOK where F_NAME = '" + ReportName.Text + "'");
         if (data != null && data.Tables[0].Select().GetLength(0) > 0)
         {
             string[] seg         = { "F_PARA", "F_TYPE" };
             string[] value       = { GetPara(), listType.SelectedValue };
             string   log_message = opt.UpDateData(seg, value, "HT_SYS_EXCEL_BOOK", " where F_NAME = '" + ReportName.Text + "'") == "Success" ? "更新报表成功" : "更新报表失败";
             log_message += "--标识:" + ReportName.Text;
             InsertTlog(log_message);
         }
         else
         {
             string[] seg         = { "F_PARA", "F_NAME", "F_SYNCHRO_TIME", "F_TYPE" };
             string[] value       = { GetPara(), ReportName.Text, DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), listType.SelectedValue };
             string   log_message = opt.InsertData(seg, value, "HT_SYS_EXCEL_BOOK") == "Success" ? "插入报表成功" : "插入报表失败";
             log_message += "--标识:" + ReportName.Text;
             InsertTlog(log_message);
         }
         tvHtml = InitTreeR();
         ScriptManager.RegisterStartupScript(UpdatePanel3, this.Page.GetType(), "", "initTreetoggle();", true);
     }
     catch (Exception ee)
     {
         Response.Write(ee.Message);
     }
 }
Example #2
0
    protected void btnModify_Click(object sender, EventArgs e)
    {
        MSYS.DAL.DbOperator opt   = new MSYS.DAL.DbOperator();
        string[]            seg   = { "ID", "NAME", "MOBILE", "PHONE", "RTXID", "GENDER", "TEAM_CODE", "EMAIL", "LEVELGROUPID", "DESCRIPTION", "ROLE" };
        string[]            value = { txtID.Text, txtName.Text, txtPhone.Text, txtCallNO.Text, txtFax.Text, getGender(), listTeam.SelectedValue, txtEmail.Text, listApt.SelectedValue, txtDscp.Text, listRole.SelectedValue };

        string log_message = opt.UpDateData(seg, value, "ht_svr_user", " where ID = '" + txtID.Text + "'") == "Success" ? "修改用户成功" : "修改用户失败";

        log_message += "--用户ID:" + txtID.Text;
        InsertTlog(log_message);
        ScriptManager.RegisterStartupScript(UpdatePanel1, this.Page.GetType(), "alert", "alert('" + log_message + "')", true);
    }
Example #3
0
    protected void btnModify_Click(object sender, EventArgs e)
    {
        string[] seg   = { "ENG_CODE", "ENG_NAME", "PROCESS_CODE", "PROCESS_NAME", "UNIT_NAME", "UNIT_CODE", "REMARK", "IS_VALID" };
        string[] value = { ENG_CODE.Text, ENG_NAME.Text, PROCESS_CODE.Text, PROCESS_NAME.Text, UNIT_NAME.Text, UNIT_CODE.Text, remark.Text, Convert.ToInt16(rdValid.Checked).ToString() };
        //string[] value = { energyConsumptionPoint.SelectedValue.ToString(), energyConsumptionPoint.SelectedItem.Text, processName.SelectedValue.ToString(), processName.SelectedItem.Text, StartTime.Text, EndTime.Text, energyConsumption.Text, department.SelectedValue.ToString(), department.SelectedItem.Text, remark.Text, Convert.ToInt16(rdValid.Checked).ToString() };
        string condition = " where ID =" + ENERGYID.Text;

        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        string flag             = opt.UpDateData(seg, value, "HT_ENG_CONSUMPTION_ITEM", condition);

        if (flag != "Success")
        {
            Response.Write("<script>alert('修改数据失败,已存在相同数据')</script>");
        }
        BindData();
    }
Example #4
0
    protected void btnGrid2Save_Click(object sender, EventArgs e)
    {
        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        Button btn      = (Button)sender;
        int    Rowindex = ((GridViewRow)btn.NamingContainer).RowIndex;//获得行号
        string ID       = GridView2.DataKeys[Rowindex].Value.ToString();
        Regex  regNum   = new Regex("^[0-9]");

        if (((TextBox)GridView2.Rows[Rowindex].FindControl("txtNodeName")).Text == "" || regNum.IsMatch(((TextBox)GridView2.Rows[Rowindex].FindControl("txtNodeName")).Text) || ((TextBox)GridView2.Rows[Rowindex].FindControl("txtOrder")).Text == "")
        {
            ScriptManager.RegisterStartupScript(UpdatePanel2, this.Page.GetType(), "alert", "alert('请输入正确格式的信息!!');", true);
            return;
        }
        try
        {
            string[] seg   = { "SECTION_CODE", "NODENAME", "ORDERS", "DESCRIPT", "CREATE_TIME", "TAG" };
            string[] value = { listSection2.SelectedValue, ((TextBox)GridView2.Rows[Rowindex].FindControl("txtNodeName")).Text, ((TextBox)GridView2.Rows[Rowindex].FindControl("txtOrder")).Text, ((TextBox)GridView2.Rows[Rowindex].FindControl("txtDscrpt")).Text, System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), ((TextBox)GridView2.Rows[Rowindex].FindControl("txtTag")).Text };
            if (ID == "0")
            {
                string log_message = opt.InsertData(seg, value, "ht_pub_path_node") == "Success" ? "新增路径节点成功" : "新增路径节点失败";
                log_message += "--详情:" + string.Join(",", value);
                InsertTlog(log_message);
            }
            else
            {
                string log_message = opt.UpDateData(seg, value, "ht_pub_path_node", " where ID = '" + ID + "'") == "Success" ? "更新路径节点成功" : "更新路径节点失败";
                log_message += "--详情:" + string.Join(",", value);
                InsertTlog(log_message);

                string query = "delete from  ht_pub_path_section  where SECTION_CODE = '" + listSection2.SelectedValue + "'";
                log_message = opt.UpDateOra(query) == "Success" ? "删除工艺路径成功" : "删除工艺路径失败";
                InsertTlog(log_message);
            }

            bindGrid2();
            if (listSection1.SelectedValue == listSection2.SelectedValue)
            {
                createGridView();
                bindGrid1();
            }
        }
        catch (Exception ee)
        {
            Response.Write(ee.Message);
        }
    }
Example #5
0
    protected void btnModify_Click(object sender, EventArgs e)
    {
        string[] seg   = { "ENG_CODE", "ENG_NAME", "PROCESS_CODE", "PROCESS_NAME", "TIME", "AMOUNT", "UNIT_CODE", "UNIT_NAME", "REMARK", "IS_VALID" };
        string[] value = { energyConsumptionPoint.SelectedValue.ToString(), energyConsumptionPoint.SelectedItem.Text, processName.SelectedValue.ToString(), processName.SelectedItem.Text, Time.Text, energyConsumption.Text, department.SelectedValue.ToString(), department.SelectedItem.Text, remark.Text, Convert.ToInt16(rdValid.Checked).ToString() };
        System.Diagnostics.Debug.WriteLine(Time.Text);
        string condition = " where ID = '" + consumeID.Text + "'";

        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        string flag             = opt.UpDateData(seg, value, "HT_ENG_MANUAL_DATA", condition);

        if (flag != "Success")
        {
            System.Diagnostics.Debug.WriteLine(flag);
            System.Diagnostics.Debug.WriteLine("eng" + energyConsumptionPoint.SelectedItem.Text);
            Response.Write("<script>alert('修改数据失败,已存在相同数据')</script>");
        }
        BindData();
    }
Example #6
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();

        string        ftID        = "";
        List <String> commandlist = new List <string>();
        string        log_message;

        if (ckFault.Checked)
        {
            string query = "select * from HT_EQ_FAULT_DB where Error_name = '" + txtName.Text + "' and eqp_TYpe = '" + listEqType.SelectedValue + "' and SPECIFIC_LOCATION = '" + txtLocation.Text + "' and SECTION_CODE = '" + listSection.SelectedValue + "' and FAULT_TYPE1 = '" + listStyle1.SelectedValue + "' and FAULT_TYPE2 = '" + listStyle2.SelectedValue + "' and FAULT_TYPE3 = '" + listStyle3.SelectedValue + "' and FAULT_TYPE4 = '" + listStyle4.SelectedValue + "' and FAULT_TYPE5 = '" + listStyle5.SelectedValue + "' and FAULT_TYPE6 = '" + listStyle6.SelectedValue + "' and SCEAN = '" + txtScean.Text + "' and ERROR_DESCRIPTION = '" + txtDescpt.Text + "' and FAILURE_CAUSE = '" + txtReason.Text + "' and SOLUTION = '" + txtSolution.Text + "' and EQUIP_CODE = '" + listEq.SelectedValue + "'";
            query = query.Replace("= ''", "is null");
            DataSet data = opt.CreateDataSetOra(query);
            if (data != null && data.Tables[0].Rows.Count > 0)
            {
                ftID = data.Tables[0].Rows[0]["ID"].ToString();
            }
            else
            {
                ftID = opt.GetSegValue("select fault_id_seq.nextval from dual", "nextval");
                string[] seg1   = { "ID", "ERROR_NAME", "EQP_TYPE", "SPECIFIC_LOCATION", "SECTION_CODE", "FAULT_TYPE1", "FAULT_TYPE2", "FAULT_TYPE3", "FAULT_TYPE4", "FAULT_TYPE5", "FAULT_TYPE6", "SCEAN", "ERROR_DESCRIPTION", "FAILURE_CAUSE", "SOLUTION", "CREATE_TIME", "EQUIP_CODE", "EDITOR" };
                string[] value1 = { ftID, txtName.Text, listEqType.SelectedValue, txtLocation.Text, listSection.SelectedValue, listStyle1.SelectedValue, listStyle2.SelectedValue, listStyle3.SelectedValue, listStyle4.SelectedValue, listStyle5.SelectedValue, listStyle6.SelectedValue, txtScean.Text, txtDescpt.Text, txtReason.Text, txtSolution.Text, System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), listEq.SelectedValue, ((MSYS.Data.SysUser)Session["User"]).text };

                log_message  = opt.InsertData(seg1, value1, "HT_EQ_FAULT_DB") == "Success" ? "故障信息入库成功" : "故障信息入库失败";
                log_message += ",故障信息ID:" + ftID;
                InsertTlog(log_message);
            }
        }

        string[] seg   = { "EQUIPMENT_ID", "EXE_TIME", "RESPONER", "MECH_AREA", "IS_FAULT", "RECORD", "RESULTS", "CONDITION", "FAULT_ID", "EXE_SEGTIME", "STATUS" };
        string[] value = { listEq.SelectedValue, System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), listOptor.SelectedValue, listArea.SelectedValue, Convert.ToInt16(ckFault.Checked).ToString(), txtRecord.Text, txtResults.Text, txtCondition.Text, ftID, txtSegcount.Text, "2" };
        log_message  = opt.UpDateData(seg, value, "HT_EQ_MT_PLAN_DETAIL", "where id = '" + txtCode.Text + "'") == "Success" ? "维修执行成功" : "维修执行失败";
        log_message += ",维修明细ID:" + txtCode.Text;
        InsertTlog(log_message);
        bindGrid();

        string alter = opt.GetSegValue("select case  when total = done then 1 else 0 end as status from (select  count(distinct t.id) as total,count( distinct t1.id) as done from HT_EQ_MT_PLAN_DETAIL t left join HT_EQ_MT_PLAN_DETAIL t1 on t1.id = t.id and t1.status >= '2' and t1.is_del = '0' where t.main_id = '" + hideMainid.Value + "'  and t.is_del = '0')", "status");

        if (alter == "1")
        {
            opt.UpDateOra("update HT_EQ_MT_PLAN set TASK_STATUS = '2' where PZ_CODE = '" + hideMainid.Value + "'  and TASK_STATUS = '1'");
        }
        ScriptManager.RegisterStartupScript(UpdatePanel2, this.Page.GetType(), "", "GridClick();", true);
    }
Example #7
0
    protected void btnRowSave_Click(object sender, EventArgs e)
    {
        bindGridView2();
        //System.Diagnostics.Debug.WriteLine((GridView2.Rows[0].TemplateControl.FindControl("product_2") as TextBox).Text);
        System.Diagnostics.Debug.WriteLine(((TextBox)GridView2.Rows[0].FindControl("霉变异味")).Text);
        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        Button btn = (Button)sender;

        //string[] text = { "smell_2", "adjoin_2", "white_2", "water_2", "input_2", "sugar_2", "soda_2", "ntri_2" };
        string[] text      = this.getSTDD();
        int      loop      = text.Length;
        int      Rowindex  = ((GridViewRow)btn.NamingContainer).RowIndex;//获得行号
        string   sql       = "select prod_code from ht_pub_prod_design where is_del=0 and prod_name='" + ((TextBox)GridView2.Rows[Rowindex].FindControl("product_2")).Text + "'";
        DataSet  data      = opt.CreateDataSetOra(sql);
        string   prod_code = data.Tables[0].Rows[0][0].ToString();
        string   teamid    = "01";
        string   team      = ((TextBox)GridView2.Rows[Rowindex].FindControl("product_2")).Text;

        if (team == "乙班")
        {
            teamid = "02";
        }
        if (team == "丙班")
        {
            teamid = "03";
        }
        //((TextBox)GridView2.Rows[Rowindex].FindControl("txtNodeName")).Text
        //string[] seg = { "SECTION_CODE", "NODENAME", "ORDERS", "DESCRIPT", "CREATE_TIME", "TAG" };
        //string[] value = { listSection2.SelectedValue, ((TextBox)GridView2.Rows[Rowindex].FindControl("txtNodeName")).Text, ((TextBox)GridView2.Rows[Rowindex].FindControl("txtOrder")).Text, ((TextBox)GridView2.Rows[Rowindex].FindControl("txtDscrpt")).Text, System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), ((TextBox)GridView2.Rows[Rowindex].FindControl("txtTag")).Text };
        for (int i = 0; i < loop; i++)
        {
            string[] seg   = { "INSPECT_VALUE" };
            string[] value = { ((TextBox)GridView2.Rows[Rowindex].FindControl(text[i])).Text };
            //string[] arg = {"703100001001","703100001002","703100001003","703100002001","703070305007","703100003001","703100003002","703100003003"};
            string[] arg         = this.getSTDDCode();
            string   log_message = opt.UpDateData(seg, value, "HT_QLT_INSPECT_RECORD", " where RECORD_TIME = '" + ((TextBox)GridView2.Rows[Rowindex].FindControl("record_time_2")).Text + "' and INSPECT_CODE='" + arg[i] + "' and prod_code = '" + prod_code + "' and is_del=0 and team_id='" + teamid + "'") == "Success" ? "更新路径节点成功" : "更新路径节点失败";
            log_message += "--详情:" + string.Join(",", value);
            InsertTlog(log_message);
        }
    }