Example #1
0
    protected void btnDone_Click(object sender, EventArgs e)//
    {
        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        //if (opt.GetSegValue("select flow_status from ht_eq_mt_plan where pz_code = '" + txtCode.Text + "'", "flow_status") != "2")
        //    return;
        for (int i = 0; i <= GridView2.Rows.Count - 1; i++)
        {
            if (((CheckBox)GridView2.Rows[i].FindControl("chk")).Checked)
            {
                string ID    = GridView2.DataKeys[i].Value.ToString();
                string query = "update ht_eq_mt_plan_detail set STATUS = '5'  where ID = '" + ID + "' and status = '4'";

                string log_message = opt.UpDateOra(query) == "Success" ? "确认完成维保计划成功" : "确认完成维保计划失败";
                log_message += "--标识:" + ID;
                InsertTlog(log_message);
            }
        }
        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 = '5' and t1.is_del = '0' where t.main_id = '" + txtCode.Text + "'  and t.is_del = '0')", "status");

        if (alter == "1")
        {
            opt.UpDateOra("update ht_eq_mt_plan set TASK_STATUS = '5' where PZ_CODE = '" + txtCode.Text + "'  and TASK_STATUS = '4'");
            bindGrid1();
        }
        bindGrid2(txtCode.Text);
    }
Example #2
0
    protected void btnTrack_Click(object sender, EventArgs e)//
    {
        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        //if (opt.GetSegValue("select flow_status from HT_EQ_RP_PLAN where pz_code = '" + txtCode.Text + "'", "flow_status") != "2")
        //{
        // ScriptManager.RegisterStartupScript(UpdatePanel2, this.Page.GetType(), "", "$('#dspcthor').hide();", true);
        //    return;
        //}
        for (int i = 0; i <= GridView2.Rows.Count - 1; i++)
        {
            if (((CheckBox)GridView2.Rows[i].FindControl("chk")).Checked)
            {
                string ID    = GridView2.DataKeys[i].Value.ToString();
                string query = "update HT_EQ_RP_PLAN_detail set STATUS = '3'  where ID = '" + ID + "' and status = '2'";

                string log_message = opt.UpDateOra(query) == "Success" ? "下发跟踪维修计划明细成功" : "下发跟踪维修计划明细失败";
                log_message += "--标识:" + ID;
                InsertTlog(log_message);
            }
        }
        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_RP_PLAN_detail t left join HT_EQ_RP_PLAN_detail t1 on t1.id = t.id and t1.status >= '3' and t1.is_del = '0'  where t.main_id = '" + txtCode.Text + "'  and t.is_del = '0')", "status");

        if (alter == "1")
        {
            opt.UpDateOra("update HT_EQ_RP_PLAN set TASK_STATUS = '3' where PZ_CODE = '" + txtCode.Text + "'  and TASK_STATUS = '2'");
            bindGrid1();
        }
        bindGrid2(txtCode.Text);
    }
Example #3
0
    //根据产品ID获取工艺标准信息并更新。
    protected static void getTechstdd_SQL(string id, string prodcode)
    {
        MSYS.Web.MateriaService.WsBaseDataInterfaceService service = new MSYS.Web.MateriaService.WsBaseDataInterfaceService();
        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        //   List<string> commandlist = new List<string>();
        try
        {
            techStddInfoVO tech = service.getTechStdById(id);

            if (tech != null)
            {
                tQaTechStdd info  = tech.techStddInfo;
                string[]    seg   = { "ID", "TECH_CODE", "TECH_NAME", "STANDARD_VOL", "REMARK", "PROD_CODE", "MODIFY_ID", "MODIFY_TIME", "IS_VALID", "IS_DEL", "E_DATE", "CREATE_ID", "CREATE_DEPT_ID", "CREATE_DATE", "CONTROL_STATUS", "B_DATE" };
                string[]    value = { id, info.standardCode, info.techStddName, info.standardVol, info.remark, prodcode, info.modifyId, info.modifyTime.ToString("yyyy-MM-dd HH:mm:ss"), info.isValid, info.isDel, info.EDate.ToString("yyyy-MM-dd HH:mm:ss"), info.createId, info.createDept, info.createDate.ToString("yyyy-MM-dd HH:mm:ss"), info.controlStatus, info.BDate.ToString("yyyy-MM-dd HH:mm:ss") };

                string temp = opt.getMergeStr(seg, value, 2, "HT_TECH_STDD_CODE");
                //    commandlist.Add(temp);
                if (opt.UpDateOra(temp) != "Success")
                {
                    System.Diagnostics.Debug.Write(temp);
                }
                if (tech.techStdDetails != null && tech.techStdDetails.Length > 0)
                {
                    string[] subseg = { "ID", "TECH_CODE", "PARA_CODE", "PARA_TYPE", "REMARK", "VALUE", "UPPER_LIMIT", "LOWER_LIMIT", "UNIT" };
                    foreach (techStddDetail detail in tech.techStdDetails)
                    {
                        if (detail.baseDown != "" && detail.baseUp != "")
                        {
                            string   stdvalue = detail.centerVal == "" ? ((Convert.ToDouble(detail.baseDown) + Convert.ToDouble(detail.baseUp)) / 2).ToString() : detail.centerVal;
                            string[] subvalue = { detail.id, info.standardCode, detail.projCode, detail.techParmType, detail.remark, stdvalue, detail.baseUp, detail.baseDown, detail.bzUnit };
                            temp = opt.getMergeStr(subseg, subvalue, 1, "HT_TECH_STDD_CODE_DETAIL");
                            //        commandlist.Add(temp);
                            if (opt.UpDateOra(temp) != "Success")
                            {
                                System.Diagnostics.Debug.Write(temp);
                            }
                        }
                    }
                }

                /*            "TECH_STDD_ID" IS '工艺技术标准主表id';
                 * "TECH_PRAM_TYPE" IS '技术参数类型';
                 * "PROJ_CODE" IS '工序项目编码';
                 * "PARM_STDD" IS '工艺参数或质量标准';
                 * "CENTER_VAL" IS '中心值';
                 * "BIAS_UP" IS '上偏值';
                 * "BIAS_DOWN" IS '下偏值';
                 * "STDD_VALUE" IS '工艺标准值';
                 * "PASS_PERCENT" IS '合格率';
                 * "BZ_UNIT" IS '计量单位';
                 * "SORT" IS '排序';
                 * "REMARK" IS '备注';*/
            }
        }
        catch (Exception ee)
        {
        }
    }
Example #4
0
    protected void btnDel_Click(object sender, EventArgs e)
    {
        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        string query            = "update ht_pub_inspect_process set IS_DEL = '1' where PROCESS_CODE = '" + txtCode.Text + "'";

        opt.UpDateOra(query);
        query = "update HT_PUB_TECH_PARA set IS_DEL = '1' where substr(PARA_CODE,1,7) =  '" + txtCode.Text + "'";
        opt.UpDateOra(query);
    }
Example #5
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 #6
0
 protected void btnDelSel2_Click(object sender, EventArgs e)
 {
     try
     {
         foreach (GridViewRow row in GridView3.Rows)
         {
             if (((CheckBox)row.FindControl("chk")).Checked)
             {
                 int    index            = row.RowIndex;
                 string planno           = GridView3.DataKeys[index].Values[0].ToString();
                 string section          = GridView3.DataKeys[index].Values[1].ToString();
                 string seg              = GridView3.DataKeys[index].Values[2].ToString();
                 string query            = "update  HT_PROD_REPORT set " + seg + " = ''  where PLANNO = '" + planno + "' and SECTION_CODE = '" + section + "'";
                 MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
                 string log_message      = opt.UpDateOra(query) == "Success" ? "删除人工录入记录成功" : "删除人工录入记录失败";
                 log_message += "--标识--计划号:" + planno + "工艺段:" + section + "字段:" + seg;
                 InsertTlog(log_message);
             }
         }
         bindGrid3();
     }
     catch (Exception ee)
     {
         Response.Write(ee.Message);
     }
 }
Example #7
0
    protected void btnDelSel_Click(object sender, EventArgs e)
    {
        try
        {
            for (int i = 0; i <= GridView1.Rows.Count - 1; i++)
            {
                GridViewRow row = GridView1.Rows[i];
                if (((CheckBox)row.FindControl("chk")).Checked)
                {
                    string mtr_code = ((DropDownList)row.FindControl("listParaName")).SelectedValue;
                    string type     = ((DropDownList)row.FindControl("listtype")).SelectedValue;

                    string query            = "update HT_QLT_STDD_CODE_DETAIL set IS_DEL = '1'  where QLT_CODE = '" + txtCode.Text + "' and PARA_CODE = '" + mtr_code + "' and QLT_TYPE = '" + type + "'";
                    MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
                    string log_message      = opt.UpDateOra(query) == "Success" ? "删除质量标准明细成功" : "删除质量标准明细失败";
                    log_message += "--标识:" + txtCode.Text + ":" + mtr_code;
                    InsertTlog(log_message);
                }
            }
            bindGrid(txtCode.Text, hideprc.Value);
        }
        catch (Exception ee)
        {
            Response.Write(ee.Message);
        }
    }
Example #8
0
    }//绑定GridView2数据源

    protected void btnGrid2Save_Click(object sender, EventArgs e)//
    {
        try
        {
            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();

            string[] seg = { "ID", "OLDVALUE", "POINTVALUE", "SAMPLE_TIME", "remark", "STATUS" };

            string[] value = { id, ((TextBox)row.FindControl("txtGridOldvalue")).Text, ((TextBox)row.FindControl("txtGridNewvalue")).Text, ((TextBox)row.FindControl("txtGridClbrtime")).Text, ((TextBox)row.FindControl("txtGridremark")).Text, "2" };

            string log_message = opt.MergeInto(seg, value, 1, "HT_EQ_MCLBR_PLAN_detail") == "Success" ? "自动校准成功" : "自动校准失败";
            log_message += "--详情:" + string.Join(",", value);
            InsertTlog(log_message);

            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_MCLBR_PLAN_detail t left join HT_EQ_MCLBR_PLAN_detail t1 on t1.id = t.id and t1.status >= '2' and t1.is_del = '0'  where t.main_id = '" + txtCode.Value + "'  and t.is_del = '0')", "status");
            if (alter == "1")
            {
                opt.UpDateOra("update HT_EQ_MCLBR_PLAN set TASK_STATUS = '2' where PZ_CODE = '" + txtCode.Value + "' and TASK_STATUS = '1'");
                bindGrid1();
            }
        }
        catch (Exception ee)
        {
            Response.Write(ee.Message);
        }
    }
Example #9
0
    }//绑定GridView2数据源

    protected void btnGrid2Save_Click(object sender, EventArgs e)//
    {
        List <string> commandlist = new List <string>();

        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        foreach (GridViewRow row in GridView2.Rows)
        {
            int    rowIndex = row.RowIndex;
            string id       = GridView2.DataKeys[rowIndex].Value.ToString();
            string status   = ((DropDownList)row.FindControl("listGrid2Status")).SelectedValue;
            if ((status == "1" || status == "2") && ((TextBox)row.FindControl("txtGridNewvalue")).Text != "")
            {
                string[] seg = { "ID", "OLDVALUE", "POINTVALUE", "SAMPLE_TIME", "remark", "STATUS" };

                string[] value = { id, ((TextBox)row.FindControl("txtGridOldvalue")).Text, ((TextBox)row.FindControl("txtGridNewvalue")).Text, ((TextBox)row.FindControl("txtGridClbrtime")).Text, ((TextBox)row.FindControl("txtGridremark")).Text, "2" };
                commandlist.Add(opt.getMergeStr(seg, value, 1, "HT_EQ_MCLBR_PLAN_detail"));
            }
        }
        if (commandlist.Count > 0)
        {
            string log_message = opt.TransactionCommand(commandlist) == "Success" ? "人工校准录入成功" : "人工校准录入失败";
            InsertTlog(log_message);
            bindGrid2(txtCode.Value);

            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_MCLBR_PLAN_detail t left join HT_EQ_MCLBR_PLAN_detail t1 on t1.id = t.id and t1.status >= '2' and t1.is_del = '0' where t.main_id = '" + txtCode.Value + "'  and t.is_del = '0')", "status");
            if (alter == "1")
            {
                opt.UpDateOra("update HT_EQ_MCLBR_PLAN set TASK_STATUS = '2' where PZ_CODE = '" + txtCode.Value + "'  and TASK_STATUS = '1'");
                bindGrid1();
            }
        }
    }
Example #10
0
    protected void btnGrid2Save_Click(object sender, EventArgs e)//
    {
        List <string> commandlist = new List <string>();

        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        foreach (GridViewRow row in GridView2.Rows)
        {
            int    rowIndex = row.RowIndex;
            string id       = GridView2.DataKeys[rowIndex].Value.ToString();
            string status   = ((DropDownList)row.FindControl("listGrid2Status")).SelectedValue;
            if ((status == "1" || status == "2") && ((TextBox)row.FindControl("txtGridpos")).Text != "")
            {
                string[] seg   = { "section", "equipment_id", "position", "pointnum", "luboil", "periodic", "style", "amount", "CREATE_TIME", "MAIN_ID", "STATUS" };
                string[] value = { ((DropDownList)row.FindControl("listGridsct")).SelectedValue, ((DropDownList)row.FindControl("listGridEq")).SelectedValue, ((TextBox)row.FindControl("txtGridpos")).Text, ((TextBox)row.FindControl("txtGridnum")).Text, ((TextBox)row.FindControl("txtGridoil")).Text, ((TextBox)row.FindControl("txtGriPric")).Text, ((TextBox)row.FindControl("txtGridStyle")).Text, ((TextBox)row.FindControl("txtGridamount")).Text, System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), hdcode.Value, "2" };
                commandlist.Add(opt.UpdateStr(seg, value, "ht_eq_lb_plan_detail", " where ID = '" + id + "'"));
            }
        }
        if (commandlist.Count > 0)
        {
            string log_message = opt.TransactionCommand(commandlist) == "Success" ? "润滑记录录入成功" : "润滑记录录入失败";
            InsertTlog(log_message);
            bindGrid2(txtCode.Value);

            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_lb_plan_detail t left join ht_eq_lb_plan_detail t1 on t1.id = t.id and t1.status >= '2' and t1.is_del = '0' where t.main_id = '" + hdcode.Value + "'  and t.is_del = '0')", "status");
            if (alter == "1")
            {
                opt.UpDateOra("update ht_eq_lb_plan set TASK_STATUS = '2' where PZ_CODE = '" + hdcode.Value + "'  and TASK_STATUS = '1'");
                bindGrid1();
            }
        }
    }
Example #11
0
 protected void btnDelSel_Click(object sender, EventArgs e)//删除选中记录
 {
     try
     {
         for (int i = 0; i <= GridView1.Rows.Count - 1; i++)
         {
             if (((CheckBox)GridView1.Rows[i].FindControl("ck")).Checked)
             {
                 string ALM_MSGID = GridView1.DataKeys[i].Value.ToString();
                 //string query = "update HT_EQ_RP_PLAN_detail set IS_DEL = '1'  where ID = '" + ID + "'";
                 string query            = "delete from fixalarms where ALM_MSGID='" + ALM_MSGID + "'";
                 MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
                 System.Diagnostics.Debug.WriteLine("delete sql" + query);
                 //opt.CreateDataSetOra(query);
                 string log_message = opt.UpDateOra(query) == "Success" ? "删除报警成功" : "删除报警信息失败";
                 log_message += "--标识:" + ID;
                 InsertTlog(log_message);
             }
         }
         bindGrid1();
     }
     catch (Exception ee)
     {
         Response.Write(ee.Message);
     }
 }
Example #12
0
    protected void btnGrid1DelSel_Click(object sender, EventArgs e)//删除选中记录
    {
        try
        {
            //    createGridView();
            for (int i = 0; i <= GridView1.Rows.Count - 1; i++)
            {
                if (((CheckBox)GridView1.Rows[i].FindControl("ck")).Checked)
                {
                    string      section_code = GridView1.DataKeys[i].Values[0].ToString();
                    string      para_code    = GridView1.DataKeys[i].Values[1].ToString();
                    GridViewRow row          = GridView1.Rows[i];

                    string query            = "delete from  ht_inner_report_contrast   where section_code = '" + section_code + "' and seg_name = '" + ((DropDownList)row.FindControl("listSeg")).SelectedValue + "' and para_code = '" + para_code + "'";
                    MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
                    string log_message      = opt.UpDateOra(query) == "Success" ? "删除报表字段成功" : "删除报表字段失败";
                    log_message += "--标识:" + section_code + para_code;
                    InsertTlog(log_message);
                }
            }
            bindGrid();
        }
        catch (Exception ee)
        {
            Response.Write(ee.Message);
        }
    }
Example #13
0
    protected void btnGrid1DelSel_Click(object sender, EventArgs e)//删除选中记录
    {
        try
        {
            //    createGridView();
            for (int i = 0; i <= GridView1.Rows.Count - 1; i++)
            {
                if (((CheckBox)GridView1.Rows[i].FindControl("ck_sel")).Checked)
                {
                    string sectioncode      = GridView1.DataKeys[i].Values[0].ToString();
                    string pathcode         = GridView1.DataKeys[i].Values[1].ToString();
                    string query            = "delete from  ht_pub_path_section  where SECTION_CODE = '" + sectioncode + "' and pathcode = '" + pathcode + "'";
                    MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
                    string log_message      = opt.UpDateOra(query) == "Success" ? "删除工艺路径成功" : "删除工艺路径失败";
                    log_message += ",工艺段:" + sectioncode + "路径" + pathcode;
                    InsertTlog(log_message);
                }
            }
            createGridView();

            bindGrid1();
        }
        catch (Exception ee)
        {
            Response.Write(ee.Message);
        }
    }
Example #14
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 #15
0
    protected void btnDone_Click(object sender, EventArgs e)//
    {
        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        if (opt.GetSegValue("select flow_status from ht_eq_mclbr_plan where pz_code = '" + txtCode.Text + "'", "flow_status") != "2")
        {
            ScriptManager.RegisterStartupScript(UpdatePanel2, this.Page.GetType(), "", "$('#dspcthor').hide();alert('请在正确状态下确认完成');", true);
            return;
        }
        List <string> commandlist = new List <string>();

        for (int i = 0; i <= GridView2.Rows.Count - 1; i++)
        {
            if (((CheckBox)GridView2.Rows[i].FindControl("chk")).Checked)
            {
                string ID = GridView2.DataKeys[i].Value.ToString();
                commandlist.Add("update HT_EQ_MCLBR_PLAN_detail set STATUS = '5'  where ID = '" + ID + "' and status = '4'");
            }
        }
        if (commandlist.Count > 0)
        {
            string log_message = opt.TransactionCommand(commandlist) == "Success" ? "确认校准反馈成功" : "确认校准反馈失败";
            InsertTlog(log_message);
            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_mclbr_plan_detail t left join ht_eq_mclbr_plan_detail t1 on t1.id = t.id and t1.status = '5' and t1.is_del = '0' where t.main_id = '" + txtCode.Text + "' and t.is_del = '0')", "status");
            if (alter == "1")
            {
                opt.UpDateOra("update HT_EQ_MCLBR_PLAN set TASK_STATUS = '5' where PZ_CODE = '" + txtCode.Text + "'  and TASK_STATUS = '4'");
                bindGrid1();
            }
            bindGrid2(txtCode.Text);
        }
    }
Example #16
0
    protected void btnDel_Click(object sender, EventArgs e)
    {
        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        string query            = "update HT_ENG_CONSUMPTION_ITEM set IS_DEL=1 where ID='" + ENERGYID.Text + "'";

        opt.UpDateOra(query);
        BindData();
    }
Example #17
0
    protected void btnDel_Click(object sender, EventArgs e)
    {
        //DataBaseOperator opt = new DataBaseOperator();
        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        string query            = "update HT_ENG_MANUAL_DATA set IS_DEL=1 where ID='" + consumeID.Text + "'";

        opt.UpDateOra(query);
        BindData();
    }
Example #18
0
    protected void btnDel2_Click(object sender, EventArgs e)
    {
        string query = "update  HT_PUB_MATERIEL set IS_DEL = '1' where  MATERIAL_CODE = '" + txtCode2.Text + "'";

        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        string log_message      = opt.UpDateOra(query) == "Success" ? "物料删除成功" : "物料删除失败";

        log_message += ",物料编码:" + txtCode2.Text;
        InsertTlog(log_message);
    }
Example #19
0
    protected void Delete_Click(object sender, EventArgs e)
    {
        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        string query            = "delete from ht_qlt_collection where para_code = '" + txtID.Text + "'";
        string log_message      = opt.UpDateOra(query) == "Success" ? "删除数采条件成功" : "删除数采条件失败";

        log_message += "--标识:" + txtID.Text;
        InsertTlog(log_message);
        setBlank();
    }
Example #20
0
 protected static void getAuxFormalu_SQL(string id, string prodCode)
 {
     MSYS.Web.MateriaService.WsBaseDataInterfaceService service = new MSYS.Web.MateriaService.WsBaseDataInterfaceService();
     MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
     //  List<string> commandlist = new List<string>();
     try
     {
         auxFormulaVO info = service.getAuxFormulaById(id);
         string       temp;
         if (info != null)
         {
             string[] seg = { "ID", "FORMULA_CODE", "FORMULA_NAME", "B_DATE", "CONTROL_STATUS", "CREATE_DATE", "CREATE_DEPT_ID", "CREATE_ID", "E_DATE", "IS_DEL", "IS_VALID", "MODIFY_ID", "MODIFY_TIME", "PROD_CODE", "REMARK", "STANDARD_VOL" };
             //string formcode = info.formulaCode == "" ? "" : "703" + info.formulaCode;//"703" + (Convert.ToInt32(prod.coatFormulaCode)+3).ToString();
             string   formcode = info.formulaCode == "" ? "" : "703" + (Convert.ToInt32(info.formulaCode) + 3).ToString();
             string[] value    = { id, formcode, info.formulaName, info.BDate.ToString("yyyy-MM-dd HH:mm:ss"), info.controlStatus, info.createDate, info.createDept, info.createId, info.EDate.ToString("yyyy-MM-dd HH:mm:ss"), info.isDel, "1", info.modifyId, info.modifyTime, prodCode, info.remark, info.standardVol };
             temp = opt.getMergeStr(seg, value, 2, "HT_QA_AUX_FORMULA");
             //    commandlist.Add(temp);
             if (opt.UpDateOra(temp) != "Success")
             {
                 System.Diagnostics.Debug.Write(temp);
             }
             if (info.auxSubList != null && info.auxSubList.Length > 0)
             {
                 string[] subseg = { "ID", "MATER_CODE", "FORMULA_CODE", "AUX_PERCENT", "AUX_SCALE", "AUX_SORT", "IS_DEL", "MATER_TYPE", "mattreeName", "REMARK" };
                 foreach (tQaAuxFormulaDetail detail in info.auxSubList)
                 {
                     string[] subvalue = { detail.id.ToString(), detail.materCode, "703" + info.formulaCode, detail.auxPercent.ToString(), detail.auxScale.ToString(), detail.auxSort.ToString(), detail.isDel, detail.materType, detail.mattreeName, detail.remark };
                     temp = opt.getMergeStr(subseg, subvalue, 3, "HT_QA_AUX_FORMULA_DETAIL");
                     //         commandlist.Add(temp);
                     if (opt.UpDateOra(temp) != "Success")
                     {
                         System.Diagnostics.Debug.Write(temp);
                     }
                 }
             }
         }
         // return commandlist;
     }
     catch (Exception ee)
     {
     }
 }
Example #21
0
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        string query            = "delete from HT_SVR_LOGIN_RECORD where  F_TIME between '" + StartTime.Text + "' and  '" + EndTime.Text + "'";
        string log_message      = opt.UpDateOra(query) == "Success" ? "删除日志成功" : "删除日志失败";

        log_message += "--开始时间:" + StartTime.Text + " 结束时间: " + EndTime.Text;
        InsertTlog(log_message);
        bindGrid();
        ScriptManager.RegisterStartupScript(UpdatePanel1, this.Page.GetType(), "alert", "alert('" + log_message + "')", true);
    }
Example #22
0
    public string InsertLocalFromMaster()
    {
        MSYS.Web.MateriaService.WsBaseDataInterfaceService service = new MSYS.Web.MateriaService.WsBaseDataInterfaceService();
        MSYS.DAL.DbOperator opt         = new MSYS.DAL.DbOperator();
        List <string>       commandlist = new List <string>();

        productEntity[] prods = service.getAllProductList(new productEntity());

        string[] matseg   = { "ID", "PROD_CODE", "PROD_NAME", "PACK_NAME", "HAND_MODE", "MATER_FORMULA_CODE", "AUX_FORMULA_CODE", "COAT_FORMULA_CODE", "REMARK", "CREATEOR_ID", "CREATE_TIME", "MODIFY_ID", "MODIFY_TIME", "STANDARD_VALUE", "XY_PROD_CODE", "IS_VALID", "IS_DEL", "B_FLOW_STATUS" };
        int      SucCount = 0;

        foreach (productEntity prod in prods)
        {
            // if (prod.prodCode.Substring(0, 3) == "703")
            // {
            commandlist.Clear();
            if (prod.xyProdCode.Substring(0, 3) != "703")
            {
                continue;
            }
            string   mformcode = ((prod.materFormulaCode == null) || prod.materFormulaCode.Length <= 3) ? "" : "7030" + (Convert.ToInt32(prod.materFormulaCode) + 20).ToString();
            string   aformcode = ((prod.auxFormulaCode == null) || prod.auxFormulaCode.Length <= 3) ? "" : "703" + prod.auxFormulaCode;
            string   cformcode = ((prod.coatFormulaCode == null) || prod.coatFormulaCode.Length <= 3) ? "" : "7030" + (Convert.ToInt32(prod.coatFormulaCode) + 3).ToString();
            string[] value     = { prod.id.ToString(), prod.xyProdCode, prod.prodName, prod.packName, Convert.ToInt32(prod.handMode).ToString()
                                   ,                       mformcode,       aformcode,     cformcode,     prod.remark,prod.createorId, prod.createTime.ToString("yyyy-MM-dd HH:mm:ss"), prod.modifyId, prod.modifyTime.ToString("yyyy-MM-dd HH:mm:ss"), prod.standardValue, prod.prodCode, "1", prod.isDel, "2" };

            string temp = opt.getMergeStr(matseg, value, 2, "HT_PUB_PROD_DESIGN");
            commandlist.Add(temp);
            if (opt.UpDateOra(temp) != "Success")
            {
                System.Diagnostics.Debug.Write(temp);
            }
            //getTechstdd_SQL(prod.techStddId, prod.xyProdCode); // java.math.BigInteger cannot be cast to java.lang.String
            getMaterFormalu_SQL(prod.materFormulaId, prod.xyProdCode);
            getAuxFormalu_SQL(prod.auxFormulaId, prod.xyProdCode); //java.math.BigDecimal cannot be cast to java.lang.Double
            getCoatFormalu_SQL(prod.coatFormulaId, prod.xyProdCode);
            if (opt.TransactionCommand(commandlist) == "Success")
            {
                commandlist.Clear();
                //commandlist.Add("update ht_pub_prod_design t set tech_stdd_code = (select r.tech_code from ht_tech_stdd_code r where substr(t.tech_stdd_code,0,3)<>'TCH' and  r.id = to_number( t.tech_stdd_code)),mater_formula_code = (select s.formula_code from ht_qa_mater_formula s where  t.mater_formula_code is not null and  s.id = to_number( t.mater_formula_code)),aux_formula_code = (select  q.formula_code from ht_qa_aux_formula q where  t.aux_formula_code is not null and  q.id = to_number( t.aux_formula_code)),coat_formula_code = (select p.formula_code from ht_qa_coat_formula p where  t.coat_formula_code is not null and  p.id = to_number( t.coat_formula_code)) where t.prod_code = '" + prod.prodCode + "'");
                commandlist.Add("update ht_qa_mater_formula_detail r set formula_code = (select t.formula_code from ht_qa_mater_formula t where t.id = r.formula_code) where r.formula_code = '" + prod.materFormulaId + "'");
                commandlist.Add("update ht_qa_aux_formula_detail r set formula_code = (select t.formula_code from ht_qa_aux_formula t where t.id = r.formula_code) where r.formula_code = '" + prod.auxFormulaId + "'");
                commandlist.Add("update ht_qa_coat_formula_detail r set formula_code = (select t.formula_code from ht_qa_coat_formula t where t.id = r.formula_code) where r.formula_code = '" + prod.coatFormulaId + "'");
                commandlist.Add("update ht_qa_Fla_formula_detail r set formula_code = (select t.formula_code from ht_qa_Fla_formula t where t.id = r.formula_code) where r.formula_code = '" + prod.coatFormulaId + "'");
                //commandlist.Add("update ht_tech_stdd_code_detail r set tech_code = (select t.tech_code from ht_tech_stdd_code t where t.id = r.tech_code) where r.tech_code = '" + prod.techStddId + "'");
                //commandlist.Add("update ht_qa_mater_formula_detail t set t.mater_flag = (select r.mat_type from ht_pub_materiel r  where r.material_code = t.mater_code)");
                opt.TransactionCommand(commandlist);
                System.Diagnostics.Debug.Write("产品更新成功" + prod.prodCode + prod.prodName);
                SucCount++;
            }
            //  }
        }
        return(SucCount.ToString() + "项产品更新成功,总记录条数:" + prods.Length);
    }
Example #23
0
    protected void btnDel_Click(object sender, EventArgs e)
    {
        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        string query            = "delete from HT_SVR_PRT_MENU where NAME = '" + txtMenu.Text + "'";
        string log_message      = opt.UpDateOra(query) == "Success" ? "删除父级菜单成功" : "删除父级菜单失败";

        log_message += "--标识:" + txtMenu.Text;
        InsertTlog(log_message);
        BindList(RightTree.Nodes, "");
        SetBlank();
    }
Example #24
0
    protected void btnSegDel_Click(object sender, EventArgs e)
    {
        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        string query            = "delete from HT_SYS_EXCEL_SEG where  F_SHEETINDEX='"
                                  + Index.Text + "' and F_BOOK_ID = '" + listReport.SelectedValue + "' and f_des = '" + DesC.Text.Trim() + DesR.Text.Trim() + "'";
        string log_message = opt.UpDateOra(query) == "Success" ? "删除报表记录成功" : "删除报表记录失败";

        log_message += "标识:F_SHEETINDEX='" + Index.Text + "' and F_BOOK_ID = '" + listReport.SelectedValue + "' and f_des = '" + DesC.Text.Trim() + DesR.Text.Trim() + "'";
        InsertTlog(log_message);
        tvHtml = InitTreeR();
        ScriptManager.RegisterStartupScript(UpdatePanel3, this.Page.GetType(), "", "initTreetoggle();", true);
    }
Example #25
0
        //根据操作用户插入日志
        public void InsertTlog(string record)
        {
            MSYS.Data.SysUser   user = (MSYS.Data.SysUser)Session["User"];
            MSYS.DAL.DbOperator opt  = new MSYS.DAL.DbOperator();
            string query             = "insert into HT_SVR_LOGIN_RECORD(F_USER,F_COMPUTER,F_TIME,F_DESCRIPT)values('"
                                       + user.text + "','"
                                       + Page.Request.UserHostName.ToString() + "','"
                                       + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','"
                                       + record + "')";

            opt.UpDateOra(query);
        }
Example #26
0
    protected void btnDspcth_Click(object sender, EventArgs e)//
    {
        bool ck = false;

        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        //if (opt.GetSegValue("select flow_status from ht_eq_mt_plan where pz_code = '" + txtCode.Text + "'", "flow_status") != "2")
        //{
        // ScriptManager.RegisterStartupScript(UpdatePanel2, this.Page.GetType(), "", "$('#dspcthor').hide();", true);
        //    return;
        //}
        for (int i = 0; i <= GridView2.Rows.Count - 1; i++)
        {
            if (((CheckBox)GridView2.Rows[i].FindControl("chk")).Checked)
            {
                ck = true;
                string ID    = GridView2.DataKeys[i].Value.ToString();
                string query = "update ht_eq_mt_plan_detail set STATUS = '1' ,TEAM_CODE = '" + listdspcth.SelectedValue + "' where ID = '" + ID + "' and status <= '1'";

                string log_message = opt.UpDateOra(query) == "Success" ? "下派维保计划成功" : "下派维保计划失败";
                log_message += "--标识:" + ID;
                InsertTlog(log_message);
            }
        }
        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 >= '1' and t1.is_del = '0'  where t.main_id = '" + txtCode.Text + "'  and t.is_del = '0')", "status");

        if (alter == "1")
        {
            opt.UpDateOra("update ht_eq_mt_plan set TASK_STATUS = '1' where PZ_CODE = '" + txtCode.Text + "' and TASK_STATUS = '0'");
            bindGrid1();
        }
        ScriptManager.RegisterStartupScript(UpdatePanel2, this.Page.GetType(), "", "$('#dspcthor').hide();", true);
        if (ck == true)
        {
            bindGrid2(txtCode.Text);
        }
        else
        {
            ScriptManager.RegisterStartupScript(UpdatePanel2, this.Page.GetType(), "", "alert('请选择派工任务');", true);
        }
    }
Example #27
0
    //删除报表
    protected void Delete_Click(object sender, EventArgs e)
    {
        string query;

        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        query = "delete from HT_SYS_EXCEL_BOOK where F_NAME = '" + ReportName.Text.Trim() + "'";
        string log_message = opt.UpDateOra(query) == "Success" ? "删除报表成功" : "删除报表失败";

        log_message += "--标识:" + ReportName.Text;
        InsertTlog(log_message);
        tvHtml = InitTreeR();
        ScriptManager.RegisterStartupScript(UpdatePanel3, this.Page.GetType(), "", "initTreetoggle();", true);
    }
Example #28
0
    protected void btnDone_Click(object sender, EventArgs e)
    {
        foreach (GridViewRow row in GridView2.Rows)
        {
            int index = row.RowIndex;

            MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
            string log_message      = opt.UpDateOra("update HT_QLT_INSPECT_EVENT set status = '6' where RECORD_ID = '" + GridView2.DataKeys[index].Values[0].ToString() + "' and INSPECT_CODE = '" + GridView2.DataKeys[index].Values[1].ToString() + "' and status = '5'") == "Success" ? "反馈工艺质量事件成功" : "反馈工艺质量事件失败";
            log_message += "--详情:" + GridView2.DataKeys[index].Values[0].ToString();
            InsertTlog(log_message);
            bindgrid2();
        }
    }
Example #29
0
    protected void btnGrid2Del_Click(object sender, EventArgs e)
    {
        Button btn      = (Button)sender;
        int    rowIndex = ((GridViewRow)btn.NamingContainer).RowIndex;
        string query    = "update ht_sys_shift set IS_DEL = '1'  where SHIFT_CODE = '" + GridView2.Rows[rowIndex].Cells[1].Text + "'";

        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        string log_message      = opt.UpDateOra(query) == "Success" ? "删除班时成功" : "删除班时失败";

        log_message += "--标识:" + GridView2.Rows[rowIndex].Cells[1].Text;
        InsertTlog(log_message);
        bindGrid2();
    }
Example #30
0
    protected void btnDel1_Click(object sender, EventArgs e)
    {
        string query = "update HT_PUB_MATTREE set IS_DEL = '1'  where MATTREE_CODE = '" + txtCode1.Text + "'";

        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        string log_message      = opt.UpDateOra(query) == "Success" ? "分类删除成功" : "分类删除失败";

        log_message += ", 分类编码:" + txtCode1.Text;
        InsertTlog(log_message);
        bindGrid(txtCode1.Text);
        tvHtml = InitTree();
        ScriptManager.RegisterStartupScript(UpdatePanel4, this.Page.GetType(), "init", " initTree();", true);
    }