Example #1
0
 protected void QueryData(object sender, EventArgs e)
 {
     string eng = (ENG_NAME.SelectedItem.Text!="") ? (" AND ENG_CODE = "+ENG_NAME.SelectedItem.Value) : "";
     System.Diagnostics.Debug.WriteLine("eng_code is "+ ENG_NAME.SelectedItem.Value);
     string process = (PROCESS_NAME.SelectedItem.Text != "") ? ("AND PROCESS_CODE = " +PROCESS_NAME.SelectedItem.Value) : "";
     System.Diagnostics.Debug.WriteLine("process_code is " + PROCESS_NAME.SelectedItem.Value);
     string unit = (UNIT_NAME.SelectedItem.Text != "") ? ("AND UNIT_CODE="+UNIT_NAME.SelectedItem.Value) : "";
     System.Diagnostics.Debug.WriteLine("unit_code is " + UNIT_NAME.SelectedItem.Value);
     if (StartTime.Text == "" || EndTime.Text == "" || unit=="")
     {
         Response.Write("测试能否接收到数据");
     }
     string query = "SELECT ID as 记录ID, ENG_NAME as 能耗点, PROCESS_NAME as 工序编码, TIME 日期, AMOUNT as 能耗总量, UNIT_NAME as 单位 FROM HT_ENG_MANUAL_DATA WHERE IS_DEL != 1 AND IS_VALID = 1 AND TIME >='" + StartTime.Text + "' AND TIME<='" + EndTime.Text+"'";
     string querycount = "SELECT SUM(AMOUNT) FROM HT_ENG_MANUAL_DATA WHERE IS_DEL = 0 AND IS_VALID = 1 AND TIME >='" + StartTime.Text + "' AND TIME<='" + EndTime.Text+"'";
     query = query + eng + process + unit;
     querycount = querycount + eng + process + unit;
     MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
     DataSet data = opt.CreateDataSetOra(query);
     if (data == null)
     {
         System.Diagnostics.Debug.WriteLine("从数据库获取信息失败");
     }
     else
     {
         GridView1.DataSource = data;
         GridView1.DataBind();
     }
     data = opt.CreateDataSetOra(querycount);
     COUNT.Text = data.Tables[0].Rows[0][0].ToString();
     return;
 }
Example #2
0
    protected void bindGrid2()
    {
        MSYS.DAL.DbOperator opt  = new MSYS.DAL.DbOperator();
        DataSet             cols = opt.CreateDataSetOra("select distinct t.inspect_code,t.inspect_name||'('||r.minus_score||')' as inspect_name from ht_qlt_inspect_proj t left join ht_qlt_inspect_stdd r on r.inspect_code = t.inspect_code left join ht_qlt_sensor_record_sub s on s.inspect_code = t.inspect_code where t.inspect_group = '4'  and t.is_del = '0' order by inspect_code");

        string query = "select t.产品名称";

        if (cols != null && cols.Tables[0].Rows.Count > 0)
        {
            foreach (DataRow row in cols.Tables[0].Rows)
            {
                query += ",t.\"" + row["inspect_name"].ToString() + "\"";
            }
        }
        query += ",t.总得分,t.产品基础分,t.实际得分,r.平均分 from hv_qlt_sensor_RealRec t left join (select g.产品名称,g.sensor_month,round(avg(g.实际得分),2) as 平均分 from hv_qlt_sensor_realRec g group by g.产品名称,g.sensor_month) r on t.产品名称 = r.产品名称 and t.sensor_month = r.sensor_month  where t.sensor_month = '" + hideMonth.Value + "' order by t.产品 ";

        DataSet data = opt.CreateDataSetOra(query);

        if (data != null && data.Tables[0].Rows.Count > 0)
        {
            GridView2.DataSource = data;
            GridView2.DataBind();
            int avgcol = data.Tables[0].Columns.Count;
            if (avgcol > 5)
            {
                //合并产品名称列
                TableCell oldtc = GridView2.Rows[0].Cells[0];
                TableCell oldsc = GridView2.Rows[0].Cells[avgcol - 1];
                oldtc.RowSpan = 1;
                for (int j = 1; j < GridView2.Rows.Count; j++)
                {
                    TableCell newtc = GridView2.Rows[j].Cells[0];
                    TableCell newsc = GridView2.Rows[j].Cells[avgcol - 1];
                    if (newtc.Text == oldtc.Text)
                    {
                        newtc.Visible       = false;
                        oldtc.RowSpan       = oldtc.RowSpan + 1;
                        oldtc.VerticalAlign = VerticalAlign.Middle;

                        if (newsc.Text == oldsc.Text)
                        {
                            newsc.Visible       = false;
                            oldsc.RowSpan       = oldsc.RowSpan + 1;
                            oldsc.VerticalAlign = VerticalAlign.Middle;
                        }
                    }
                    else
                    {
                        oldtc         = newtc;
                        oldtc.RowSpan = 1;
                        oldsc         = newsc;
                        oldsc.RowSpan = 1;
                    }
                }
            }
        }
    }
Example #3
0
    protected void btnGrid1Edit_Click(object sender, EventArgs e)
    {
        Button btn      = (Button)sender;
        int    rowIndex = ((GridViewRow)btn.NamingContainer).RowIndex;
        string id       = GridView1.DataKeys[rowIndex].Value.ToString();

        hdID.Value = id;
        string query = "select g.work_date as 日期,g.shift_code as 班时,g.team_code as 班组,g1.create_id as 交班人,g1.modify_id as 接班人,g1.remark as 备注,g.date_begin as 开始时间,g.date_end as 结束时间,MAINTENANCE_TYPE from Ht_Prod_Schedule g   left join HT_EQ_MT_SHIFT g1 on g1.ID = g.id   where g.id = '" + id + "'";

        if (rdElec.Checked)
        {
            query += " and g1.MAINTENANCE_TYPE = '0'";
        }
        if (rdMchnc.Checked)
        {
            query += " and g1.MAINTENANCE_TYPE = '1'";
        }
        MSYS.DAL.DbOperator opt  = new MSYS.DAL.DbOperator();
        DataSet             data = opt.CreateDataSetOra(query);

        if (data != null && data.Tables[0].Rows.Count > 0)
        {
            DataRow row = data.Tables[0].Rows[0];
            txtDate.Text            = row["日期"].ToString();
            listShift.SelectedValue = row["班时"].ToString();
            listTeam.SelectedValue  = row["班组"].ToString();

            listolder.SelectedValue = row["交班人"].ToString();
            listnewer.SelectedValue = row["接班人"].ToString();
            txtRemark.Text          = row["备注"].ToString();

            txtBtime.Text          = row["开始时间"].ToString();
            txtEtime.Text          = row["结束时间"].ToString();
            listtype.SelectedValue = row["MAINTENANCE_TYPE"].ToString();
        }
        else
        {
            query = "select g.work_date as 日期,g.shift_code as 班时,g.team_code as 班组,g.date_begin as 开始时间,g.date_end as 结束时间 from Ht_Prod_Schedule g   where g.id = '" + id + "'";
            data  = opt.CreateDataSetOra(query);
            if (data != null && data.Tables[0].Rows.Count > 0)
            {
                DataRow row = data.Tables[0].Rows[0];
                txtDate.Text            = row["日期"].ToString();
                listShift.SelectedValue = row["班时"].ToString();
                listTeam.SelectedValue  = row["班组"].ToString();

                txtBtime.Text           = row["开始时间"].ToString();
                txtEtime.Text           = row["结束时间"].ToString();
                listtype.SelectedValue  = (rdElec.Checked ? "0" : "1");
                listolder.SelectedValue = "";
                listnewer.SelectedValue = "";
                txtRemark.Text          = "";
            }
        }
        bindGrid2();
    }
Example #4
0
    protected void btnModify_Click(object sender, EventArgs e)
    {
        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        if (txtCode.Text.Length == 10 && txtCode.Text.Substring(0, 5) == listSection.SelectedValue)
        {
            string   oldepath = opt.GetSegValue("select * from HT_PUB_TECH_PARA where PARA_CODE = '" + txtCode.Text + "'", "PATH_NODE");
            string[] seg      = { "PARA_CODE", "PARA_NAME", "PARA_UNIT", "PARA_TYPE", "REMARK", "IS_VALID", "CREATE_ID", "CREATE_TIME", "EQUIP_CODE", "SET_TAG", "VALUE_TAG", "BUSS_ID", "PATH_NODE" };
            string[] value    = { txtCode.Text, txtName.Text, txtUnit.Text, getType(), txtDscrp.Text, Convert.ToInt16(rdValid.Checked).ToString(), ((MSYS.Data.SysUser)Session["User"]).id, System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), listEquip.SelectedValue, txtSetTag.Text, txtValueTag.Text, listApt.SelectedValue, listPathnode.SelectedValue };

            string log_message;
            if (opt.MergeInto(seg, value, 1, "HT_PUB_TECH_PARA") == "Success")
            {
                log_message = "保存参数点成功";
                tvHtml      = InitTree();
                string[] procseg    = { };
                object[] procvalues = { };
                opt.ExecProcedures("Create_Online_month_Report", procseg, procvalues);
                if (ckQuaAnalyze.Checked && oldepath != listPathnode.SelectedValue)
                {
                    DataSet points = opt.CreateDataSetOra("select distinct path_code,path_name from ht_pub_para_weight t ");
                    if (points != null && points.Tables[0].Rows.Count > 0)
                    {
                        foreach (DataRow row in points.Tables[0].Rows)
                        {
                            if (listPathnode.SelectedValue == "")
                            {
                                opt.UpDateOra("insert into ht_pub_para_weight(para_code,path_code,weight,path_name)values ('" + txtCode.Text + "','" + row["path_code"].ToString() + "','0.2','" + row["path_name"].ToString() + "')");
                            }
                            else
                            {
                                DataSet paras = opt.CreateDataSetOra("select  r.para_code,t.pathcode from ht_pub_path_prod t  left join ht_pub_path_node s on s.is_del = '0' and  s.section_code = t.section_code and substr(t.section_path,s.orders,1) = '0' left join ht_pub_tech_para r on r.path_node = s.id and r.is_del = '0' and r.para_type like '______1%' where t.pathcode = '" + row["path_code"].ToString() + "' and t.is_del = '0' and r.para_code = '" + txtCode.Text + "'");
                                if (paras != null && paras.Tables[0].Rows.Count > 0)
                                {
                                    opt.UpDateOra("delete from ht_pub_para_weight where para_code = '" + txtCode.Text + "' and path_code = '" + row["path_code"].ToString() + "'");
                                }
                            }
                        }
                    }
                }
                // opt.UpDateOra("delete from ht_pub_para_weight where PATH_CODE = '" + listPathAll.SelectedValue + "'");
                // opt.UpDateOra("insert into ht_pub_para_weight ( select  r.para_code,t.pathcode,'0',0.2,'test1' from ht_pub_path_prod t  left join ht_pub_path_node s on s.is_del = '0' and  s.section_code = t.section_code and substr(t.section_path,s.orders,1) = '1' left join ht_pub_tech_para r on r.path_node = s.id and r.is_del = '0' and r.para_type like '______1%' where t.pathcode = '" + listPathAll.SelectedValue + "' and t.is_del = '0' and r.para_code is not null union select r.para_code,'" + listPathAll.SelectedValue + "','0',0.2,'test1' from ht_pub_tech_para r where r.para_type like '______1%' and r.path_node is null and r.is_del = '0')");
            }
            else
            {
                log_message = "保存参数点失败";
            }
            log_message += "--数据详情:" + string.Join(",", value);
            ScriptManager.RegisterStartupScript(UpdatePanel4, this.Page.GetType(), "sucess", "initTree();alert('" + log_message + "');", true);
            InsertTlog(log_message);
        }
        else
        {
            ScriptManager.RegisterStartupScript(UpdatePanel4, this.Page.GetType(), "message", "alert('请确认工艺参数所属工艺段是否正确')", true);
        }
    }
Example #5
0
 protected DataSet sectionbind()
 {
     MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
     if (rdType1.Checked)
     {
         return(opt.CreateDataSetOra("select r.section_code,r.section_name from ht_pub_tech_section r left join ht_pub_tech_para t on substr(t.para_code,1,5) = r.section_code and t.para_type like '_______1%' and t.is_valid = '1' and t.is_del = '0' where r.is_del = '0' and r.is_valid = '1' and t.para_code is not null union select '' as section_code,'' as section_name from dual order by section_code"));
     }
     else
     {
         return(opt.CreateDataSetOra("select r.section_code,r.section_name from ht_pub_tech_section r left join ht_pub_tech_para t on substr(t.para_code,1,5) = r.section_code and t.para_type like '___1___1%' and t.is_valid = '1' and t.is_del = '0' where r.is_del = '0' and r.is_valid = '1' and t.para_code is not null union select '' as section_code,'' as section_name from dual order by section_code"));
     }
 }
Example #6
0
    protected void bindGrid()
    {
        string query = "select distinct g.section_name as 工艺段, '' as 路径选择, '' as 路径详情,g.section_code from ht_pub_tech_section g left join ht_pub_path_section h on h.section_code = g.section_code where h.section_code is not null and  g.is_valid = '1' and g.is_del = '0' and g.IS_PATH_CONFIG = '1' order by g.section_code";

        MSYS.DAL.DbOperator opt  = new MSYS.DAL.DbOperator();
        DataSet             data = opt.CreateDataSetOra(query);

        GridView1.DataSource = data;
        GridView1.DataBind();
        if (data != null && data.Tables[0].Rows.Count > 0)
        {
            string[] subpath = listPathAll.SelectedValue.Split('-');
            for (int i = 0; i < GridView1.Rows.Count; i++)
            {
                DataRowView mydrv = data.Tables[0].DefaultView[i];
                ((TextBox)GridView1.Rows[i].FindControl("txtSection")).Text = mydrv["工艺段"].ToString();
                DropDownList list = (DropDownList)GridView1.Rows[i].FindControl("listpath");
                opt.bindDropDownList(list, "select pathname,pathcode from ht_pub_path_section where section_code = '" + mydrv["section_code"].ToString() + "' and is_del = '0' ", "pathname", "pathcode");
                list.SelectedValue = mydrv["路径详情"].ToString();
                if (subpath.Length == GridView1.Rows.Count)
                {
                    list.SelectedValue = subpath[i].Substring(5);
                }
                query = createQuery(mydrv["section_code"].ToString());
                if (query != "")
                {
                    query += " and pathcode = '" + list.SelectedValue + "'";

                    DataSet set = opt.CreateDataSetOra(query);
                    if (set != null && set.Tables[0].Rows.Count > 0)
                    {
                        for (int j = 1; j < set.Tables[0].Columns.Count - 2; j++)
                        {
                            CheckBox ck = new CheckBox();
                            if (0 == set.Tables[0].Rows.Count)
                            {
                                ck.Checked = false;
                            }
                            else
                            {
                                ck.Checked = (set.Tables[0].Rows[0][j].ToString() == "1");
                            }

                            ck.Text = set.Tables[0].Columns[j].Caption;
                            GridView1.Rows[i].Cells[2].Controls.Add(ck);
                        }
                    }
                }
            }
        }
        ScriptManager.RegisterStartupScript(UpdatePanel1, this.Page.GetType(), "disable", " $(\"input[type$='checkbox']\").attr('disabled', 'disabled');", true);
    }//绑定GridView4数据源
Example #7
0
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        MSYS.Web.PlanService.WsPlanForGSInterfaceService service = new MSYS.Web.PlanService.WsPlanForGSInterfaceService();
        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        quarterPlanVO[]     pb  = service.getQuarterPlanList(System.DateTime.Now.Year.ToString(), GetQuarterNum(System.DateTime.Now));
        if (pb == null)
        {
            return;
        }
        // prodAssignVO[] pvo = service.getProdAssignListForGS("", "");
        string[] seg  = { "id", "PLAN_NAME", "FLOW_STATUS", "ISSUED_STATUS", "PLAN_YEAR", "QUARTER", "IS_DEL", "REMARK", "CREATE_ID" };
        string[] seg2 = { "QUARTER_PLAN_ID", "prod_code ", "plan_OUTPUT_1", "PLAN_OUTPUT_2", "PLAN_OUTPUT_3", "TOTAL_OUTPUT", "IS_DEL" };
        foreach (quarterPlanVO p in pb)
        {
            //string plname = p.quarterPlan.planName == "" ? System.DateTime.Now.Year.ToString() + "-" + GetQuarterNum(new DateTime()) + "季度生产计划" :p.quarterPlan.planName;
            string plname = System.DateTime.Now.Year.ToString() + "-" + Convert.ToInt32(GetQuarterNum(System.DateTime.Now)).ToString() + "季度生产计划";
            System.Diagnostics.Debug.WriteLine(plname);
            System.Diagnostics.Debug.WriteLine(p.quarterPlan.id);
            string   sqllog = "select id from ht_svr_user where loginname = '" + p.quarterPlan.createId + "'";
            string   cid    = opt.CreateDataSetOra(sqllog).Tables[0].Rows[0][0].ToString();
            string[] value  = { p.quarterPlan.pzCode, plname, "2", p.quarterPlan.issuedStatus, p.quarterPlan.planYear, Convert.ToInt32(GetQuarterNum(System.DateTime.Now)).ToString(), "0", p.quarterPlan.remark, cid };
            //  string[] value2 = { p.id };
            opt.MergeInto(seg, value, 2, "HT_PROD_SEASON_PLAN");
            foreach (tAmQuarterPlanDetail pd in p.subList)
            {
                System.Diagnostics.Debug.WriteLine(pd.prodCode);
                System.Diagnostics.Debug.WriteLine(System.DateTime.Now.Year.ToString());
                System.Diagnostics.Debug.WriteLine(GetQuarterNum(System.DateTime.Now));
                string  sql = "select prod_code from ht_pub_prod_design where xy_prod_code = " + pd.prodCode;
                DataSet ds  = opt.CreateDataSetOra(sql);
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    continue;
                }
                string xy_prod_code = ds.Tables[0].Rows[0][0].ToString();

                if (xy_prod_code.Substring(0, 3) != "703")
                {
                    continue;
                }
                // string[] value2 = { p.quarterPlan.id, pd.prodCode, pd.planOutput1.ToString(), pd.planOutput2.ToString(), pd.planOutput3.ToString(), pd.totalOutput.ToString(), pd.isDel };
                string[] value2 = { p.quarterPlan.pzCode, xy_prod_code, pd.planOutput1.ToString(), pd.planOutput2.ToString(), pd.planOutput3.ToString(), pd.totalOutput.ToString(), pd.isDel };
                opt.MergeInto(seg2, value2, 2, "HT_PROD_SEASON_PLAN_DETAIL");
            }
            // opt.getMergeStr(seg2, value2, 1, "HT_PROD_MONTH_PLAN_DETAIL");
            // dt.Rows.Add(paras);
        }
        bindGrid1();
        ScriptManager.RegisterStartupScript(UpdatePanel1, this.Page.GetType(), "", "alert('同步完成');", true);
    }
Example #8
0
    protected void bindStatistic()
    {
        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        string query;

        if (listTeam.SelectedValue == "")
        {
            query = "select a5.prod_name as 产品, a1.score as 在线考核分,a2.score as 理化检测得分,a3.score as 感观评测得分,a4.score as 过程检测得分,  (select weight from ht_qlt_weight where id='1')*nvl(a1.score,100) +  (select weight from ht_qlt_weight where id='2')*nvl(a2.score,100)+ (select weight from ht_qlt_weight where id='3')*nvl(a3.score,100) + (select weight from ht_qlt_weight where id='4')*nvl(a4.score,100) as 总得分 from (select distinct prod_code from ht_qlt_inspect_record r where substr(r.record_time,1,10) = '" + txtStartTime.Text + "' union select distinct prod_code from ht_qlt_data_record where substr(b_time,1,10) = '" + txtStartTime.Text + "') a left join ht_pub_prod_design a5 on  a5.prod_code = a.prod_code left join (select sum(r.score * s.weight) as score,r.prod_code  from  (select a.section,sum(a.quarate * c.weight*100) as score,a.prod_code from (select r.prod_code, substr(r.para_code,1,5) as section,r.para_code,sum(r.quarate*r.count)/sum(r.count) as quarate from ht_qlt_data_record r where substr(r.b_time,1,10) = '" + txtStartTime.Text + "' group by r.para_code,r.prod_code) a   left join ht_pub_tech_para b on b.para_code  = a.para_code and b.para_type  like '______1%'  left join ht_qlt_weight c on c.id = a.para_code  group by a.section,a.prod_code )r  left join ht_pub_tech_section  s on s.section_code = r.section group by r.prod_code )a1 on a5.prod_name = a.prod_code left join (select round(avg(得分),2) as score,产品 from hv_phychem_daily_report  r left join ht_pub_prod_design t on r.产品 = t.prod_name  where substr(r.检测时间,1,10) = '" + txtStartTime.Text + "' group by 产品)a2 on a5.prod_name = a2.产品 left join (select round(avg(得分),2) as score,产品 from hv_sensor_daily_report  r left join ht_pub_prod_design t on r.产品 = t.prod_name  where substr(r.检测时间,1,10) = '" + txtStartTime.Text + "' group by 产品)a3 on a5.prod_name = a3.产品 left join (select round(avg(得分),2) as score,产品 from hv_process_daily_report  r left join ht_pub_prod_design t on r.产品 = t.prod_name  where substr(r.检测时间,1,10) = '" + txtStartTime.Text + "' group by 产品)a4 on a5.prod_name = a4.产品 order by a5.prod_name";
        }
        else
        {
            query = " select a5.prod_name as 产品,a6.team_name as 班组, a1.score as 在线考核分,a2.score as 理化检测得分,a3.score as 感观评测得分,a4.score as 过程检测得分,  (select weight from ht_qlt_weight where id='1')*nvl(a1.score,100) +  (select weight from ht_qlt_weight where id='2')*nvl(a2.score,100)+ (select weight from ht_qlt_weight where id='3')*nvl(a3.score,100) + (select weight from ht_qlt_weight where id='4')*nvl(a4.score,100) as 总得分   from  (select distinct team_id as team, prod_code from ht_qlt_inspect_record  where substr(record_time,1,10) =  '" + txtStartTime.Text + "' union select distinct team, prod_code from ht_qlt_data_record  where substr(b_time,1,10) =  '" + txtStartTime.Text + "') a  left join ht_pub_prod_design a5 on  a5.prod_code = a.prod_code  left join ht_sys_team a6 on a6.team_code = a.team  left join (select sum(r.score * s.weight) as score,r.prod_code,r.team  from  (select a.section,sum(a.quarate * c.weight*100) as score,a.prod_code,a.team from (select r.prod_code,r.team, substr(r.para_code,1,5) as section,r.para_code,sum(r.quarate*r.count)/sum(r.count) as quarate from ht_qlt_data_record r where substr(r.b_time,1,10) =  '" + txtStartTime.Text + "' group by r.para_code,r.prod_code,r.team) a   left join ht_pub_tech_para b on b.para_code  = a.para_code and b.para_type  like '______1%'  left join ht_qlt_weight c on c.id = a.para_code  group by a.section,a.prod_code ,a.team)r  left join ht_pub_tech_section  s on s.section_code = r.section group by r.prod_code,r.team  )a1 on a.prod_code = a1.prod_code and a6.team_code = a1.team  left join (select round(avg(得分),2) as score,产品,班组 from hv_phychem_daily_report  r left join ht_pub_prod_design t on r.产品 = t.prod_name  where substr(r.检测时间,1,10) =  '" + txtStartTime.Text + "' group by 产品,班组)a2 on a5.prod_name = a2.产品 and a6.team_name = a2.班组  left join (select round(avg(得分),2) as score,产品,班组 from hv_sensor_daily_report  r left join ht_pub_prod_design t on r.产品 = t.prod_name  where substr(r.检测时间,1,10) =  '" + txtStartTime.Text + "' group by 产品,班组)a3 on a5.prod_name = a3.产品 and a6.team_name = a3.班组  left join (select round(avg(得分),2) as score,产品,班组 from hv_process_daily_report  r left join ht_pub_prod_design t on r.产品 = t.prod_name  where substr(r.检测时间,1,10) =  '" + txtStartTime.Text + "' group by 产品,班组)a4 on a5.prod_name = a4.产品 and a6.team_name = a4.班组 where a6.team_code = '" + listTeam.SelectedValue + "'";
        }

        GridAll.DataSource = opt.CreateDataSetOra(query);
        GridAll.DataBind();
        query = "select * from hv_online_daily_report t where substr(时间,1,10) = '" + txtStartTime.Text + "'";
        if (listTeam.SelectedValue != "")
        {
            query += " and t.班组 = '" + listTeam.SelectedItem.Text + "'";
        }
        query += " order by t.产品,t.班组";
        GridView1.DataSource = opt.CreateDataSetOra(query);
        GridView1.DataBind();
        query = "select * from hv_process_daily_report t where substr(检测时间,1,10) = '" + txtStartTime.Text + "'";
        if (listTeam.SelectedValue != "")
        {
            query += " and t.班组 = '" + listTeam.SelectedItem.Text + "'";
        }
        query += " order by t.产品,t.班组";
        GridView2.DataSource = opt.CreateDataSetOra(query);
        GridView2.DataBind();
        query = "select * from hv_phychem_daily_report t where substr(检测时间,1,10) = '" + txtStartTime.Text + "'";
        if (listTeam.SelectedValue != "")
        {
            query += " and t.班组 = '" + listTeam.SelectedItem.Text + "'";
        }
        query += " order by t.产品,t.班组";
        GridView3.DataSource = opt.CreateDataSetOra(query);
        GridView3.DataBind();
        query = "select * from hv_sensor_daily_report t where substr(检测时间,1,10) = '" + txtStartTime.Text + "'";
        if (listTeam.SelectedValue != "")
        {
            query += " and t.班组 = '" + listTeam.SelectedItem.Text + "'";
        }
        query += " order by t.产品,t.班组";
        GridView4.DataSource = opt.CreateDataSetOra(query);
        GridView4.DataBind();
    }
Example #9
0
    protected void btnGridview_Click(object sender, EventArgs e)//查看领退明细
    {
        Button btn      = (Button)sender;
        int    rowIndex = ((GridViewRow)btn.NamingContainer).RowIndex;

        txtCode.Text = GridView1.DataKeys[rowIndex].Values[0].ToString();

        MSYS.DAL.DbOperator opt  = new MSYS.DAL.DbOperator();
        DataSet             data = opt.CreateDataSetOra("select * from HT_STRG_FLAVOR  where ORDER_SN =  '" + txtCode.Text + "'");

        if (data != null && data.Tables[0].Rows.Count > 0)
        {
            txtPrdctdate.Text         = data.Tables[0].Rows[0]["OUT_DATE"].ToString();
            listStatus.SelectedValue  = data.Tables[0].Rows[0]["AUDIT_MARK"].ToString();
            listStorage.SelectedValue = data.Tables[0].Rows[0]["WARE_HOUSE_ID"].ToString();
            listApt.SelectedValue     = data.Tables[0].Rows[0]["DEPT_ID"].ToString();
            if (listPrdctPlan.Items.FindByValue(data.Tables[0].Rows[0]["MONTHPLANNO"].ToString()) != null)
            {
                listPrdctPlan.SelectedValue = data.Tables[0].Rows[0]["MONTHPLANNO"].ToString();
                txtPrdctPlan.Text           = listPrdctPlan.SelectedValue;
                txtPrdctPlan.Visible        = false;
                listPrdctPlan.Visible       = true;
            }
            else
            {
                listPrdctPlan.SelectedValue = "";
                txtPrdctPlan.Text           = data.Tables[0].Rows[0]["MONTHPLANNO"].ToString();
                txtPrdctPlan.Visible        = true;
                listPrdctPlan.Visible       = false;
            }
            string temp = opt.GetSegValue("select Prod_code from ht_prod_month_plan_detail where plan_no = '" + txtPrdctPlan.Text + "'", "PROD_CODE");
            if (listPrdct.Items.FindByValue(temp) != null)
            {
                listPrdct.SelectedValue = temp;
            }
            else
            {
                listPrdct.SelectedValue = "";
            }

            txtBatchNum.Text = data.Tables[0].Rows[0]["BATCHNUM"].ToString();

            DropDownListShift.SelectedValue = data.Tables[0].Rows[0]["shift_code"].ToString();
            DropDownListTeam.SelectedValue  = data.Tables[0].Rows[0]["team_code"].ToString();
            txtValiddate.Text = data.Tables[0].Rows[0]["EXPIRED_DATE"].ToString();


            txtStemSum.Text           = data.Tables[0].Rows[0]["CABOSUM"].ToString();
            listCreator.SelectedValue = data.Tables[0].Rows[0]["CREATOR_ID"].ToString();
        }
        if (listStatus.SelectedItem.Text == "未提交")
        {
            SetEnable(true);
        }
        else
        {
            SetEnable(false);
        }
        bindGrid2();
    }
Example #10
0
    /// <summary>
    /// tab2操作
    /// </summary>
    protected void bindGrid1()
    {
        string query = hideQuery.Value;

        if (query != "")
        {
            MSYS.DAL.DbOperator opt  = new MSYS.DAL.DbOperator();
            DataSet             set  = opt.CreateDataSetOra(query);
            DataTable           data = new DataTable();
            data = set.Tables[0];

            object[] value = new object[data.Columns.Count];
            value[0] = "";
            for (int i = 1; i < value.Length - 2; i++)
            {
                value[i] = "0";
            }
            value[data.Columns.Count - 2] = listSection1.SelectedValue;
            value[data.Columns.Count - 1] = "";
            data.Rows.Add(value);

            attachData(data);
        }
        else
        {
            GridView1.DataSource = null;
            GridView1.DataBind();
        }
    }
Example #11
0
    protected void createView()
    {
        MSYS.DAL.DbOperator opt  = new MSYS.DAL.DbOperator();
        DataSet             data = opt.CreateDataSetOra("select * from ht_qlt_weight t where is_del = '0' order by ID ");

        if (data != null && data.Tables[0].Rows.Count == 4)
        {
            DataRowCollection Rows = data.Tables[0].Rows;
            StringBuilder     str  = new StringBuilder();

            str.Append(" select nvl(r.产品,nvl(s.产品,nvl(t.产品,p.产品))) as 产品,nvl(r.班组,nvl(s.班组,nvl(t.班组,p.班组))) as 班组,nvl(r.时间,nvl(s.检测时间,nvl(t.检测时间,p.检测时间))) as 时间,r.总分 as 在线考核分,s.得分 as 过程检测得分,t.得分 as 理化检测得分,p.得分 as 感观评测得分,nvl(r.总分,100) *");
            str.Append(Rows[0]["Weight"].ToString());
            str.Append("+ nvl(t.得分,100) * ");
            str.Append(Rows[1]["Weight"].ToString());
            str.Append("+ nvl(p.得分,100) * ");
            str.Append(Rows[2]["Weight"].ToString());
            str.Append("+ nvl(s.得分,100) * ");
            str.Append(Rows[3]["Weight"].ToString());
            str.Append(" as 总得分 from (");
            str.Append(getOnlineScore());
            str.Append(")r");
            str.Append(" full join (");
            str.Append(getProcessScore());
            str.Append(") s on s.产品 = r.产品 and s.班组 = r.班组 and s.检测时间 = r.时间");
            str.Append(" full join (");
            str.Append(getPhycheScore());
            str.Append(") t on (t.产品 = r.产品 and t.班组 = r.班组 and t.检测时间 = r.时间 ) or (t.产品 = s.产品 and t.班组 = s.班组 and t.检测时间 = s.检测时间 )");
            str.Append(" full join (");
            str.Append(getSensorScore());
            str.Append(") p on (p.产品 = r.产品 and p.班组 = r.班组 and p.检测时间 = r.时间) or (p.产品 = s.产品 and p.班组 = s.班组 and p.检测时间 = s.检测时间 ) or (t.产品 = p.产品 and t.班组 = p.班组 and t.检测时间 = p.检测时间 ) ");
            opt.UpDateOra("create or replace view hv_QLT_daily_report as " + str.ToString());
        }
    }
Example #12
0
    protected void btnGridView_Click(object sender, EventArgs e)
    {
        Button btn      = (Button)sender;
        int    Rowindex = ((GridViewRow)btn.NamingContainer).RowIndex;//获得行号

        hdcode.Value = GridView1.DataKeys[Rowindex].Value.ToString();
        string query = "select * from HT_EQ_FAULT_DB where id = '" + hdcode.Value.ToString() + "'";

        MSYS.DAL.DbOperator opt  = new MSYS.DAL.DbOperator();
        DataSet             data = opt.CreateDataSetOra(query);

        if (data != null && data.Tables[0].Rows.Count > 0)
        {
            DataRow row = data.Tables[0].Rows[0];
            txtName.Text              = row["ERROR_NAME"].ToString();
            listEq.SelectedValue      = row["EQUIP_CODE"].ToString();
            listEqType.SelectedValue  = row["EQP_TYPE"].ToString();
            txtEditor.Text            = row["EDITOR"].ToString();
            txtLocation.Text          = row["SPECIFIC_LOCATION"].ToString();
            listSection.SelectedValue = row["SECTION_CODE"].ToString();
            listStyle1.SelectedValue  = row["FAULT_TYPE1"].ToString();
            listStyle2.SelectedValue  = row["FAULT_TYPE2"].ToString();
            listStyle3.SelectedValue  = row["FAULT_TYPE3"].ToString();
            listStyle4.SelectedValue  = row["FAULT_TYPE4"].ToString();
            listStyle5.SelectedValue  = row["FAULT_TYPE5"].ToString();
            listStyle6.SelectedValue  = row["FAULT_TYPE6"].ToString();
            txtScean.Text             = row["SCEAN"].ToString();
            txtDescpt.Text            = row["ERROR_DESCRIPTION"].ToString();
            txtReason.Text            = row["FAILURE_CAUSE"].ToString();
            txtSolution.Text          = row["SOLUTION"].ToString();
        }
        ScriptManager.RegisterStartupScript(UpdatePanel1, this.Page.GetType(), "", "treeClick();", true);
    }
Example #13
0
    protected void bindGrid()
    {
        string query = "select t1.eq_name as 故障设备, t.error_name as 故障名,t.specific_location as 故障位置,t.editor as 编制人,t.CREATE_TIME as 记录时间,t.ID   from ht_eq_fault_db t left join ht_eq_eqp_tbl t1 on t1.idkey = t.equip_code  where t.is_del = '0'";

        if (listType1.SelectedValue != "")
        {
            query += " and t.FAULT_TYPE1 = '" + listType1.SelectedValue + "'";
        }
        if (listType2.SelectedValue != "")
        {
            query += " and t.FAULT_TYPE2 = '" + listType2.SelectedValue + "'";
        }
        if (listType3.SelectedValue != "")
        {
            query += " and t.FAULT_TYPE3 = '" + listType3.SelectedValue + "'";
        }
        if (listType4.SelectedValue != "")
        {
            query += " and t.FAULT_TYPE4 = '" + listType4.SelectedValue + "'";
        }
        if (listType5.SelectedValue != "")
        {
            query += " and t.FAULT_TYPE5 = '" + listType5.SelectedValue + "'";
        }
        if (listType6.SelectedValue != "")
        {
            query += " and t.FAULT_TYPE6 = '" + listType6.SelectedValue + "'";
        }
        query += " order by t.CREATE_TIME";
        MSYS.DAL.DbOperator opt  = new MSYS.DAL.DbOperator();
        DataSet             data = opt.CreateDataSetOra(query);

        GridView1.DataSource = data;
        GridView1.DataBind();
    }
Example #14
0
 protected void bindData3(string paracode)
 {
     try
     {
         string query             = "select * from HT_PUB_TECH_PARA where  PARA_CODE = '" + paracode + "'";
         MSYS.DAL.DbOperator opt  = new MSYS.DAL.DbOperator();
         DataSet             data = opt.CreateDataSetOra(query);
         if (data != null && data.Tables[0].Rows.Count > 0)
         {
             DataRow row = data.Tables[0].Rows[0];
             txtCode.Text     = paracode;
             txtName.Text     = row["PARA_NAME"].ToString();
             txtUnit.Text     = row["PARA_UNIT"].ToString();
             txtSetTag.Text   = row["SET_TAG"].ToString();
             txtValueTag.Text = row["VALUE_TAG"].ToString();
             setType(row["PARA_TYPE"].ToString());
             txtDscrp.Text   = row["REMARK"].ToString();
             rdValid.Checked = ("1" == row["IS_VALID"].ToString());
             opt.bindDropDownList(listEquip, "select EQ_NAME,IDKEY from ht_eq_eqp_tbl t where t.section_code = '" + txtCode.Text.Substring(0, 5) + "'", "EQ_NAME", "IDKEY");
             listEquip.SelectedValue   = row["EQUIP_CODE"].ToString();
             listSection.SelectedValue = paracode.Substring(0, 5);
             listApt.SelectedValue     = row["BUSS_ID"].ToString();
             opt.bindDropDownList(listPathnode, "select nodename,id from ht_pub_path_node t where section_code = '" + listSection.SelectedValue + "' and is_del = '0'", "nodename", "id");
             listPathnode.SelectedValue = row["PATH_NODE"].ToString();
         }
     }
     catch (Exception error)
     {
         ScriptManager.RegisterStartupScript(UpdatePanel4, this.Page.GetType(), "error", "<Script>alert('" + error.Message + "')</Script>", false);
     }
 }
Example #15
0
    protected void btnGrid2View_Click(object sender, EventArgs e)
    {
        Button      btn      = (Button)sender;
        GridViewRow Row      = (GridViewRow)btn.NamingContainer;
        int         rowIndex = Row.RowIndex;
        string      ID       = GridView2.DataKeys[rowIndex].Value.ToString();

        MSYS.DAL.DbOperator opt  = new MSYS.DAL.DbOperator();
        DataSet             data = opt.CreateDataSetOra("select * from HT_EQ_RP_PLAN_DETAIL where id = '" + ID + "'");

        if (data != null && data.Tables[0].Rows.Count > 0)
        {
            DataRow row = data.Tables[0].Rows[0];
            txtCodeS.Text           = ID;
            listEq.SelectedValue    = row["EQUIPMENT_ID"].ToString();
            txtOpttime.Text         = row["EXE_TIME"].ToString();
            listOptor.SelectedValue = row["RESPONER"].ToString();
            listArea.SelectedValue  = row["MECH_AREA"].ToString();
            txtRecord.Text          = row["REASON"].ToString() + ";" + row["CONTENT"].ToString() + ";" + row["REMARK"].ToString();
            string ftid = row["FAULT_ID"].ToString();
            txtFalut.Text    = opt.GetSegValue("select '故障名:'||t.error_name||';故障描述:'|| t.error_description||';故障场景:'||t.scean||';故障原因:'||t.failure_cause||';解决方案'||t.solution as faultinfo from ht_eq_fault_db t  where t.ID = '" + ftid + "'", "faultinfo");
            txtFeedback.Text = row["FEEDBACK"].ToString() + ";" + row["REMARKPLUS"].ToString();
        }
        ScriptManager.RegisterStartupScript(UpdatePanel3, this.Page.GetType(), "", "$('.shade').fadeIn(200);", true);
    }
Example #16
0
    protected void btngrid1View_Click(object sender, EventArgs e)
    {
        Button      btn   = (Button)sender;
        GridViewRow row   = (GridViewRow)btn.NamingContainer;
        int         index = row.RowIndex;

        hideEventID.Value = GridView1.DataKeys[index].Values[0].ToString();
        txtPara.Text      = row.Cells[2].Text;
        txtPlanno.Text    = row.Cells[1].Text;
        txtStarttime.Text = row.Cells[3].Text;
        txtEndtime.Text   = row.Cells[4].Text;
        MSYS.DAL.DbOperator opt  = new MSYS.DAL.DbOperator();
        DataSet             data = opt.CreateDataSetOra("select * from ht_tech_event where id = '" + hideEventID.Value + "'");

        if (data != null && data.Tables[0].Rows.Count > 0)
        {
            DataRow dr = data.Tables[0].Rows[0];
            if (dr["EDITOR"].ToString() == "")
            {
                txtEditor.Text = ((MSYS.Data.SysUser)Session["User"]).text;
            }
            else
            {
                txtEditor.Text = dr["EDITOR"].ToString();
            }
            txtEdittime.Text = dr["EDITTIME"].ToString();
            txtReason.Text   = dr["REASON"].ToString();
            txtDescrpt.Text  = dr["COMMENTS"].ToString();
        }
    }
Example #17
0
    public string  InitTree()
    {
        MSYS.DAL.DbOperator opt  = new MSYS.DAL.DbOperator();
        DataSet             data = opt.CreateDataSetOra("select g.section_code,g.section_name from ht_pub_tech_section g where g.IS_VALID = '1' and g.IS_DEL = '0' order by g.section_code ");

        if (data != null && data.Tables[0].Rows.Count > 0)
        {
            string    tvHtml = "<ul id='browser' class='filetree treeview-famfamfam'>";
            DataRow[] rows   = data.Tables[0].Select();
            foreach (DataRow row in rows)
            {
                // tvHtml += "<li ><span class='folder'  onclick = \"treeClick('" + row["section_code"].ToString() + "')\">" + row["section_name"].ToString() + "</span>";
                tvHtml += "<li ><span class='folder'  value = '" + row["section_code"].ToString() + "'>" + row["section_name"].ToString() + "</span>";
                tvHtml += InitTreeSectionPara(row["section_code"].ToString());
                tvHtml += InitTreeEquip(row["section_code"].ToString());
                tvHtml += "</li>";
            }
            tvHtml += "</ul>";
            return(tvHtml);
        }
        else
        {
            return("");
        }
    }
Example #18
0
    protected void bindGrid2(string code)
    {
        string query = "select t.section as 工段,t.equipment_id as 设备名称,t.point as 数据点,t.OLDVALUE as 原值,t.POINTVALUE as 校准值,t.SAMPLE_TIME as 校准时间,t.STATUS as 状态,t.remark as 备注 ,t.ID  from HT_EQ_MCLBR_PLAN_detail  t where t.main_id = '" + code + "' and t.is_del = '0'";

        MSYS.DAL.DbOperator opt  = new MSYS.DAL.DbOperator();
        DataSet             data = opt.CreateDataSetOra(query);

        GridView2.DataSource = data;
        GridView2.DataBind();
        if (data != null && data.Tables[0].Rows.Count > 0)
        {
            for (int i = GridView2.PageSize * GridView2.PageIndex; i < GridView2.PageSize * (GridView2.PageIndex + 1) && i < data.Tables[0].Rows.Count; i++)
            {
                int          j     = i - GridView2.PageSize * GridView2.PageIndex;
                DataRowView  mydrv = data.Tables[0].DefaultView[i];
                GridViewRow  row   = GridView2.Rows[j];
                DropDownList list1 = (DropDownList)row.FindControl("listGridsct");
                DropDownList list2 = (DropDownList)row.FindControl("listGridEq");
                DropDownList list3 = (DropDownList)row.FindControl("listGridPoint");
                list1.SelectedValue = mydrv["工段"].ToString();
                opt.bindDropDownList(list2, "select IDKEY,EQ_NAME  from ht_eq_eqp_tbl where section_code = '" + list1.SelectedValue + "'  order by idkey", "EQ_NAME", "IDKEY");
                list2.SelectedValue = mydrv["设备名称"].ToString();
                opt.bindDropDownList(list3, "select para_code,para_name from ht_pub_tech_para where equip_code = '" + list2.SelectedValue + "' order by para_code ", "para_name", "para_code");
                list3.SelectedValue = mydrv["数据点"].ToString();
                ((TextBox)row.FindControl("txtGridOldvalue")).Text = mydrv["原值"].ToString();
                ((TextBox)row.FindControl("txtGridNewvalue")).Text = mydrv["校准值"].ToString();
                ((TextBox)row.FindControl("txtGridClbrtime")).Text = mydrv["校准时间"].ToString();
                ((DropDownList)row.FindControl("listGrid2Status")).SelectedValue = mydrv["状态"].ToString();
                ((TextBox)row.FindControl("txtGridremark")).Text = mydrv["备注"].ToString();
            }
        }
    }//绑定GridView2数据源
Example #19
0
    protected string initLevel2Menu(string prtID, string roleID)
    {
        string resultHtml = "";
        string query      = "select distinct t.f_role ,t.f_right,q.name as prtName,q.menulevel ,q.ID as prtID from  ht_svr_sys_role t left join ht_svr_sys_menu s on substr(t.f_right,to_number(s.f_ID),1) ='1' and s.f_type = '0' and s.is_del = '0'  left join ht_svr_prt_menu q on q.id = s.f_pid  and q.pid = '" + prtID + "'  where  q.menulevel = '2' and t.f_id = '" + roleID + "' order by q.ID";

        MSYS.DAL.DbOperator opt  = new MSYS.DAL.DbOperator();
        DataSet             data = opt.CreateDataSetOra(query);

        resultHtml += "<ul style='height: 300px;'>\r\n";
        resultHtml += addChildMenu(prtID, roleID);
        if (data != null && data.Tables[0].Rows.Count > 0)
        {
            foreach (DataRow row in data.Tables[0].Rows)
            {
                resultHtml += " <li><cite></cite><a class='subhead'>" + row["prtName"].ToString() + "</a>\r\n";
                resultHtml += "<ul>\r\n";
                resultHtml += addChildMenu(row["prtID"].ToString(), roleID);
                resultHtml += "</ul>\r\n";
                resultHtml += "</li>\r\n";
            }
        }
        resultHtml += "</ul>\r\n";

        return(resultHtml);
    }
Example #20
0
    protected void bindStatistic()
    {
        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        string query;

        query = "select r.产品, t.output as 产量,t.output/s.output as 产量占比,r.* from hv_qlt_month_prod_report r left join (select t.PROD_CODE,substr(t.STARTTIME,1,7) as month, sum(decode(t.para_code,'7030500029',t.SEG_VALUE))  * sum(decode(t.para_code,'7030500030',t.SECTION_CODE)) as output from hv_prod_report t where t.SECTION_CODE = '70305' and t.starttime like '" + txtStartTime.Text + "%' group by substr(t.starttime,1,7),t.prod_code) t on t.PROD_CODE = r.prod_code and t.month = r.month left join (select substr(t.STARTTIME,1,7) as month, sum(decode(t.para_code,'7030500029',t.SEG_VALUE))  * sum(decode(t.para_code,'7030500030',t.SEG_VALUE)) as output from hv_prod_report t where t.SECTION_CODE = '70305' and t.starttime like '" + txtStartTime.Text + "%' group by substr(t.starttime,1,7)) s   on s.month = r.month where r.month = '" + txtStartTime.Text + "'";
        DataSet data = opt.CreateDataSetOra(query);

        GridAll.DataSource = data;
        GridAll.DataBind();
        if (data != null && data.Tables[0].Rows.Count > 0)
        {
            labout.Text = opt.GetSegValue("select substr(t.STARTTIME,1,7) as month, sum(decode(t.para_code,'7030500029',t.SEG_VALUE))  * sum(decode(t.para_code,'7030500030',t.SEG_VALUE)) as output from hv_prod_report t where t.SECTION_CODE = '70305' and t.starttime like '" + txtStartTime.Text + "%' group by substr(t.starttime,1,7)", "output");
            labout.Text = (labout.Text == "NoRecord" || labout.Text == "") ? "0" : labout.Text;
            if (labout.Text != "0")
            {
                double total = Convert.ToDouble(labout.Text);
                double score = 0;
                foreach (DataRow row in data.Tables[0].Rows)
                {
                    score += Convert.ToDouble(row["产量"].ToString()) / total * Convert.ToDouble(row["产品得分"].ToString());
                }
                labScore.Text = score.ToString();
            }
        }
    }
Example #21
0
    protected void bindGrid2(string code)
    {
        string query = "select t.mech_area as 区域,t.equipment_id as 设备名称,t.reason as 维修原因,t.content as 维修内容,t.exp_finish_time as 期望完成时间,t.STATUS as 状态,r.name as 执行人,t.remark as 备注 ,t.ID  from HT_EQ_RP_PLAN_detail t  left join ht_svr_user r on r.id = t.responer  where t.main_id = '" + code + "' and t.is_del = '0'";

        MSYS.DAL.DbOperator opt  = new MSYS.DAL.DbOperator();
        DataSet             data = opt.CreateDataSetOra(query);

        GridView2.DataSource = data;
        GridView2.DataBind();
        if (data != null && data.Tables[0].Rows.Count > 0)
        {
            for (int i = 0; i <= GridView2.Rows.Count - 1; i++)
            {
                DataRowView  mydrv = data.Tables[0].DefaultView[i];
                GridViewRow  row   = GridView2.Rows[i];
                DropDownList list1 = (DropDownList)row.FindControl("listGridarea");
                DropDownList list2 = (DropDownList)row.FindControl("listGridEq");
                list1.SelectedValue = mydrv["区域"].ToString();
                opt.bindDropDownList(list2, "select distinct t.IDKEY,t.EQ_NAME  from ht_eq_eqp_tbl t  where t.is_del = '0' and t.is_valid = '1'  and t.section_code = '" + list1.SelectedValue + "'  order by t.idkey", "EQ_NAME", "IDKEY");
                list2.SelectedValue = mydrv["设备名称"].ToString();
                ((TextBox)row.FindControl("txtGridReason")).Text  = mydrv["维修原因"].ToString();
                ((TextBox)row.FindControl("txtGridcntnt")).Text   = mydrv["维修内容"].ToString();
                ((TextBox)row.FindControl("txtGridExptime")).Text = mydrv["期望完成时间"].ToString();
                ((DropDownList)row.FindControl("listGrid2Status")).SelectedValue = mydrv["状态"].ToString();
                ((TextBox)row.FindControl("txtGridremark")).Text = mydrv["备注"].ToString();
            }
        }
    }//绑定GridView2数据源
Example #22
0
 protected void Page_Load(object sender, EventArgs e)
 {
     base.PageLoad(sender, e);
     if (!IsPostBack)
     {
         MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
         opt.bindDropDownList(listApt, "select F_CODE,F_NAME from HT_SVR_ORG_GROUP", "F_NAME", "F_CODE");
         opt.bindDropDownList(listRole, "select * from ht_svr_sys_role t", "F_ROLE", "F_ID");
         opt.bindDropDownList(listTeam, "select team_code,team_name from ht_sys_team t where t.is_del = '0' order by team_code", "team_name", "team_code");
         if (Session["User"] != null)
         {
             SysUser user = (SysUser)Session["User"];
             txtID.Text             = user.id;
             txtName.Text           = user.text;
             listApt.SelectedValue  = user.OwningBusinessUnitId;
             listRole.SelectedValue = user.UserRoleID;
             DataSet dt = opt.CreateDataSetOra("select * from ht_svr_user where ID = '" + txtID.Text + "'");
             if (dt != null && dt.Tables[0].Rows.Count > 0)
             {
                 DataRow row = dt.Tables[0].Rows[0];
                 txtPhone.Text  = row["MOBILE"].ToString();
                 txtCallNO.Text = row["PHONE"].ToString();
                 txtFax.Text    = row["RTXID"].ToString();
                 setGender(row["GENDER"].ToString());
                 listTeam.SelectedValue = row["TEAM_CODE"].ToString();
                 txtEmail.Text          = row["EMAIL"].ToString();
                 txtDscp.Text           = row["DESCRIPTION"].ToString();
             }
         }
     }
 }
Example #23
0
    protected void bindGrid1()
    {
        string query = "select t.mt_name as 维修计划,t1.f_name as 部门, t2.name as 审批状态,t3.name as 执行状态,t.remark as 备注,t.pz_code from HT_EQ_RP_PLAN t left join ht_svr_org_group t1 on t1.f_code = t.create_dept_id   left join ht_inner_aprv_status t2 on t2.id = t.flow_status left join ht_inner_eqexe_status t3 on t3.id = t.task_status  where t.expired_date between '" + txtStart.Text + "' and '" + txtStop.Text + "'  and t.IS_DEL = '0'";

        MSYS.DAL.DbOperator opt  = new MSYS.DAL.DbOperator();
        DataSet             data = opt.CreateDataSetOra(query);

        GridView1.DataSource = data;
        GridView1.DataBind();
        if (data != null && data.Tables[0].Rows.Count > 0)
        {
            for (int i = GridView1.PageSize * GridView1.PageIndex; i < GridView1.PageSize * (GridView1.PageIndex + 1) && i < data.Tables[0].Rows.Count; i++)
            {
                DataRowView mydrv = data.Tables[0].DefaultView[i];
                GridViewRow row   = GridView1.Rows[i - GridView1.PageSize * GridView1.PageIndex];
                ((Label)row.FindControl("labAprv")).Text = mydrv["审批状态"].ToString();

                ((Label)row.FindControl("labexe")).Text = mydrv["执行状态"].ToString();
                if (!(mydrv["审批状态"].ToString() == "未提交" || mydrv["审批状态"].ToString() == "未通过"))
                {
                    ((Button)row.FindControl("btnSubmit")).Enabled  = false;
                    ((Button)row.FindControl("btnSubmit")).CssClass = "btngrey";
                    ((Button)row.FindControl("btnGridview")).Text   = "查看计划";
                }
                else
                {
                    ((Button)row.FindControl("btnSubmit")).Enabled  = true;
                    ((Button)row.FindControl("btnSubmit")).CssClass = "btn1 auth";
                    ((Button)row.FindControl("btnGridview")).Text   = "编制计划";
                }
            }
        }
    }//绑定gridview1数据源
Example #24
0
 private void fillFalutData(string id)
 {
     if (id == "")
     {
         SetBlank();
     }
     else
     {
         MSYS.DAL.DbOperator opt  = new MSYS.DAL.DbOperator();
         DataSet             data = opt.CreateDataSetOra("select * from ht_eq_fault_db where ID = '" + id + "'");
         if (data != null && data.Tables[0].Rows.Count > 0)
         {
             DataRow row = data.Tables[0].Rows[0];
             txtFtID.Text              = id;
             txtName.Text              = row["ERROR_NAME"].ToString();
             listEqType.SelectedValue  = row["EQP_TYPE"].ToString();
             txtLocation.Text          = row["SPECIFIC_LOCATION"].ToString();
             listSection.SelectedValue = row["SECTION_CODE"].ToString();
             listStyle1.SelectedValue  = row["FAULT_TYPE1"].ToString();
             listStyle2.SelectedValue  = row["FAULT_TYPE2"].ToString();
             listStyle3.SelectedValue  = row["FAULT_TYPE3"].ToString();
             listStyle4.SelectedValue  = row["FAULT_TYPE4"].ToString();
             listStyle5.SelectedValue  = row["FAULT_TYPE5"].ToString();
             listStyle6.SelectedValue  = row["FAULT_TYPE6"].ToString();
             txtScean.Text             = row["SCEAN"].ToString();
             txtDescpt.Text            = row["ERROR_DESCRIPTION"].ToString();
             txtReason.Text            = row["FAILURE_CAUSE"].ToString();
             txtSolution.Text          = row["SOLUTION"].ToString();
         }
     }
 }
Example #25
0
    protected void btngrid2Deal_Click(object sender, EventArgs e)
    {
        Button      btn = (Button)sender;
        GridViewRow row = (GridViewRow)btn.NamingContainer;

        txtID.Text    = GridView2.DataKeys[row.RowIndex].Value.ToString();
        txtCodeZ.Text = txtCode.Value;
        string status = ((DropDownList)row.FindControl("listGrid2Status")).SelectedValue;

        if (status == "5")
        {
            btnModify.Visible = false;
        }
        else
        {
            btnModify.Visible = true;
        }
        MSYS.DAL.DbOperator opt  = new MSYS.DAL.DbOperator();
        DataSet             data = opt.CreateDataSetOra("select * from ht_eq_mt_plan_detail where ID = '" + txtID.Text + "'");

        if (data != null && data.Tables[0].Rows.Count > 0)
        {
            DataRow drow = data.Tables[0].Rows[0];
            txtScean.Text = drow["FEEDBACK"].ToString();

            txtPlus.Text = drow["REMARKPLUS"].ToString();
        }
        else
        {
            txtScean.Text = "";
            txtPlus.Text  = "";
        }

        ScriptManager.RegisterStartupScript(updtpanel1, this.Page.GetType(), "", " $('.shade').fadeIn(200);", true);
    }
Example #26
0
    protected void BindList(TreeNodeCollection ncTree, string pID)
    {
        ncTree.Clear();
        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        string query            = "select ID,Name,MenuLEVEL,PID from ht_svr_prt_menu ";

        if (pID == "")
        {
            query += " where pid is null ";
        }
        else
        {
            query += " where PID = '" + pID + "'";
        }
        DataSet data = opt.CreateDataSetOra(query);

        if (data != null && data.Tables[0].Rows.Count > 0)
        {
            DataRow[] Rows = data.Tables[0].Select();
            foreach (DataRow row in Rows)
            {
                TreeNode pnode = new TreeNode(row["Name"].ToString(), row["ID"].ToString() + "_" + row["MenuLEVEL"].ToString() + "_" + row["PID"].ToString());
                BindList(pnode.ChildNodes, row["ID"].ToString());
                ncTree.Add(pnode);
            }
        }
    }
Example #27
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
            string ftID             = "";
            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[] seg   = { "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[] value = { 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 };

                string log_message = opt.InsertData(seg, value, "HT_EQ_FAULT_DB") == "Success" ? "故障信息入库成功" : "故障信息入库失败";
                log_message += "--详情:" + string.Join(",", value);
                InsertTlog(log_message);
                bindGrid();
            }
        }
        catch (Exception ee)
        {
            Response.Write(ee.Message);
        }
    }
Example #28
0
    protected string getProcessScore()
    {
        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();

        string        query = "select inspect_code,inspect_name from ht_qlt_inspect_proj  where INSPECT_TYPE = '0' and is_del = '0' order by inspect_code";
        DataSet       data  = opt.CreateDataSetOra(query);
        StringBuilder sql   = new StringBuilder();
        StringBuilder str   = new StringBuilder();
        StringBuilder temp  = new StringBuilder();

        if (data != null && data.Tables[0].Rows.Count > 0)
        {
            int i = 1;
            temp.Append("100");
            sql.Append("select g1.prod_code as 产品,g1.team_id as 班组,g1.record_time as 检测时间");
            foreach (DataRow row in data.Tables[0].Rows)
            {
                string name = row["inspect_name"].ToString();
                string code = row["inspect_code"].ToString();

                temp.Append("-nvl(g");
                temp.Append(i.ToString());
                temp.Append(".score,0)");

                if (i > 1)
                {
                    str.Append(" left join ");
                }

                str.Append("(select   a.prod_code,a.team_id,a.shift_ID,a.record_time ,nvl(b.score,0) as score, nvl(a.inspect_value,0) as ");
                str.Append(name);
                str.Append("  from ht_qlt_inspect_record a left join ht_qlt_inspect_event b on b.record_id = a.id where a.inspect_code = '");
                str.Append(code);
                str.Append("')g");

                str.Append(i.ToString());
                if (i > 1)
                {
                    str.Append(" on g1.prod_code = g");
                    str.Append(i.ToString());
                    str.Append(".prod_code  and g1.team_id = g");
                    str.Append(i.ToString());
                    str.Append(".team_id   and g1.record_time = g");
                    str.Append(i.ToString());
                    str.Append(".record_time  ");
                }
                i++;
            }
            temp.Append(" as 得分");
            sql.Append(",");
            sql.Append(temp);
            sql.Append(" from ");
            sql.Append(str.ToString());
            return(sql.ToString());
        }
        else
        {
            return(null);
        }
    }
Example #29
0
    protected void btngrid1Deal_Click(object sender, EventArgs e)
    {
        Button      btn = (Button)sender;
        GridViewRow row = (GridViewRow)btn.NamingContainer;

        hdType.Value            = "1";
        txtEventID.Text         = GridView1.DataKeys[row.RowIndex].Values[0].ToString();
        listStyle.SelectedValue = GridView1.DataKeys[row.RowIndex].Values[1].ToString();
        if (((Button)row.FindControl("btngrid1Deal")).Text == "查看")
        {
            MSYS.DAL.DbOperator opt  = new MSYS.DAL.DbOperator();
            DataSet             data = opt.CreateDataSetOra("select * from HT_QLT_AUTO_EVENT where RECORD_ID = '" + txtEventID.Text + "' and SORT = '" + listStyle.SelectedValue + "'");
            if (data != null && data.Tables[0].Rows.Count > 0)
            {
                DataRow drow = data.Tables[0].Rows[0];
                txtScean.Text  = drow["SCENE"].ToString();
                txtReason.Text = drow["REASON"].ToString();
                txtDeal.Text   = drow["DEAL"].ToString();
                txtPlus.Text   = drow["REMARK"].ToString();
            }
        }
        else
        {
            txtScean.Text  = "";
            txtReason.Text = "";
            txtDeal.Text   = "";
            txtPlus.Text   = "";
        }

        ScriptManager.RegisterStartupScript(updtpanel1, this.Page.GetType(), "", " $('#craftdetail').fadeIn(200);", true);
    }
Example #30
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        string query = "select section_code,seg_name,seg_info,unit,para_code  from ht_inner_report_contrast where is_del = '0' ";

        if (listSection.SelectedValue != "")
        {
            query += " and section_code = '" + listSection.SelectedValue + "'";
        }
        query += " order by section_code,para_code";
        MSYS.DAL.DbOperator opt  = new MSYS.DAL.DbOperator();
        DataSet             set  = opt.CreateDataSetOra(query);
        DataTable           data = set.Tables[0];

        if (data == null)
        {
            data = new DataTable();
            data.Columns.Add("section_code");
            data.Columns.Add("seg_name");
            data.Columns.Add("seg_info");
            data.Columns.Add("unit");
            data.Columns.Add("para_code");
        }
        object[] value = { "", "", "", "", "" };
        data.Rows.Add(value);
        gridbind(data);
    }