Esempio n. 1
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (txtCodeS.Text.Split('-').Length >= GridView1.Rows.Count)
        {
            MSYS.DAL.DbOperator opt         = new MSYS.DAL.DbOperator();
            List <String>       commandlist = new List <String>();
            string[]            seg         = { "PATHNAME", "SECTION_CODE", "PATHCODE", "SECTION_PATH" };

            for (int i = 0; i < GridView1.Rows.Count; i++)
            {
                DropDownList list    = (DropDownList)GridView1.Rows[i].FindControl("listpath");
                string       section = GridView1.DataKeys[i].Value.ToString();
                string[]     value   = { txtNameS.Text, section, txtCodeS.Text, list.SelectedValue };
                commandlist.Add(opt.getMergeStr(seg, value, 2, "HT_PUB_PATH_PROD"));
            }
            string log_message = opt.TransactionCommand(commandlist) == "Success" ? "保存全线路径成功" : "保存全线路径失败";
            log_message += "--标识:" + listPathAll.SelectedValue;
            InsertTlog(log_message);
            commandlist.Clear();
            commandlist.Add("delete HT_PUB_PARA_WEIGHT where PATH_NAME = '" + txtNameS.Text + "' or path_code ='" + txtCodeS.Text + "'");

            commandlist.Add("insert into ht_pub_para_weight ( select  r.para_code,t.pathcode,'0',0.2,'" + txtNameS.Text + "' 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 = '" + txtCodeS.Text + "' and t.is_del = '0' and r.para_code is not null union select r.para_code,'" + txtCodeS.Text + "','0',0.2,'" + txtNameS.Text + "' from ht_pub_tech_para r where r.para_type like '______1%' and r.path_node is null and r.is_del = '0')");
            opt.TransactionCommand(commandlist);
            opt.bindDropDownList(listPathAll, "select distinct pathname,pathcode  from ht_pub_path_prod t where t.is_del = '0' order by pathname", "pathname", "pathcode");
            listPathAll.SelectedValue = txtCodeS.Text;
            bindGrid();
        }
    }
Esempio n. 2
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);
    }
Esempio n. 3
0
 protected void btnDelSel_Click(object sender, EventArgs e)
 {
     try
     {
         List <string>       commandlist = new List <string>();
         MSYS.DAL.DbOperator opt         = new MSYS.DAL.DbOperator();
         string planlist = "";
         for (int i = 0; i <= GridView2.Rows.Count - 1; i++)
         {
             if (((CheckBox)GridView2.Rows[i].FindControl("chk")).Checked)
             {
                 string mtr_code = ((TextBox)GridView2.Rows[i].FindControl("txtPlanNo")).Text;
                 commandlist.Add("update HT_PROD_MONTH_PLAN_DETAIL set IS_DEL = '1'  where PLAN_NO = '" + mtr_code + "'");
                 planlist += mtr_code + ",";
             }
         }
         if (commandlist.Count > 0)
         {
             if (hideAdjust.Value == "1")
             {
                 commandlist.Add("update HT_PROD_MONTH_PLAN set ADJUST_STATUS = '1',MODIFY_ID = '" + ((MSYS.Data.SysUser)Session["User"]).id + "' where ID = '" + hidePlanID.Value + "'");
             }
             string log_message = opt.TransactionCommand(commandlist) == "Success" ? "删除生产计划明细成功" : "删除生产计划明细失败";
             log_message += "--标识:" + planlist;
             InsertTlog(log_message);
             bindGrid2(hidePlanID.Value);
             bindGrid1();
         }
     }
     catch (Exception ee)
     {
         Response.Write(ee.Message);
     }
 }
Esempio n. 4
0
    protected void btnGridDel_Click(object sender, EventArgs e)//删除选中记录
    {
        try
        {
            List <string>       commandlist = new List <string>();
            MSYS.DAL.DbOperator opt         = new MSYS.DAL.DbOperator();
            for (int i = 0; i <= GridView1.Rows.Count - 1; i++)
            {
                if (((CheckBox)GridView1.Rows[i].FindControl("chk")).Checked)
                {
                    commandlist.Clear();
                    string order_sn = GridView1.DataKeys[i].Value.ToString();

                    commandlist.Add("update HT_EQ_RP_PLAN set IS_DEL = '1'  where PZ_CODE = '" + order_sn + "'");
                    commandlist.Add("update HT_EQ_RP_PLAN_detail set IS_DEL = '1'  where MAIN_ID = '" + order_sn + "'");
                    commandlist.Add("delete from HT_PUB_APRV_FLOWINFO where BUSIN_ID = '" + order_sn + "'");

                    string log_message = opt.TransactionCommand(commandlist) == "Success" ? "删除维修计划成功" : "删除维修计划失败";
                    log_message += "--标识:" + order_sn;
                    InsertTlog(log_message);
                }
            }
            bindGrid1();
        }
        catch (Exception ee)
        {
            Response.Write(ee.Message);
        }
    }
Esempio n. 5
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)
        {
            string[] seg = { "INSPECT_CODE", "STDD_CODE", "UPPER_VALUE", "LOWER_VALUE", "MINUS_SCORE", "REMARK", "CREATE_ID", "CREATE_TIME" };

            string[] value = { ((DropDownList)row.FindControl("listInspect")).SelectedValue, listVersion.SelectedValue, ((TextBox)row.FindControl("txtUpper")).Text, ((TextBox)row.FindControl("txtLower")).Text, ((TextBox)row.FindControl("txtScore")).Text, ((TextBox)row.FindControl("txtRemark")).Text, ((MSYS.Data.SysUser)Session["User"]).id, System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") };
            commandlist.Add(opt.getMergeStr(seg, value, 2, "HT_QLT_INSPECT_STDD_SUB"));
        }
        string log_message = opt.TransactionCommand(commandlist) == "Success" ? "保存过程检测标准成功" : "保存过程检测标准失败";

        //if (log_message == "保存过程检测标准成功")
        //{

        //    string[] procseg = { };
        //    object[] procvalues = { };
        //    opt.ExecProcedures("Create_process_Report", procseg, procvalues);
        //}
        InsertTlog(log_message);
        bindGrid2();
        ScriptManager.RegisterStartupScript(UpdatePanel5, this.Page.GetType(), "success", "alert('" + log_message + "')", true);
    }
Esempio n. 6
0
    protected void btnGrid2Apply_Click(object sender, EventArgs e)
    {
        try
        {
            MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
            Button      btn         = (Button)sender;
            GridViewRow row         = (GridViewRow)btn.NamingContainer;
            int         Rowindex    = row.RowIndex;//获得行号
            string      planno      = GridView2.DataKeys[Rowindex].Value.ToString();


            List <string> commandlist = new List <string>();
            //  commandlist.Add("update HT_PROD_MONTH_PLAN_DETAIL set EXE_STATUS = '4',MATER_STATUS = '1' where PLAN_NO = '" + planno + "' and EXE_STATUS = '2'");
            commandlist.Add("update HT_PROD_MONTH_PLAN_DETAIL set  MATER_STATUS = '1',COAT_STATUS = '1',Flavor_status = '1' where PLAN_NO = '" + planno + "' and EXE_STATUS <> '3'");
            string log_message = opt.TransactionCommand(commandlist) == "Success" ? "申请物料成功" : "申请物料失败";
            log_message += "--详情:" + planno;
            InsertTlog(log_message);

            bindGrid2(hidePlanID.Value);
        }
        catch (Exception ee)
        {
            Response.Write(ee.Message);
        }
    }
Esempio n. 7
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();
            }
        }
    }
Esempio n. 8
0
 protected void btnGrid2Del_Click(object sender, EventArgs e)
 {
     try
     {
         Button btn                      = (Button)sender;
         int    Rowindex                 = ((GridViewRow)btn.NamingContainer).RowIndex;//获得行号
         string mtr_code                 = ((TextBox)GridView2.Rows[Rowindex].FindControl("txtPlanNo")).Text;
         MSYS.DAL.DbOperator opt         = new MSYS.DAL.DbOperator();
         List <string>       commandlist = new List <string>();
         commandlist.Add("update HT_PROD_MONTH_PLAN_DETAIL set IS_DEL = '1'  where PLAN_NO = '" + mtr_code + "'");
         if (hideAdjust.Value == "1")
         {
             commandlist.Add("update HT_PROD_MONTH_PLAN set ADJUST_STATUS = '1',MODIFY_ID = '" + ((MSYS.Data.SysUser)Session["User"]).id + "' where ID = '" + hidePlanID.Value + "'");
         }
         string log_message = opt.TransactionCommand(commandlist) == "Success" ? "删除月度生产计划明细成功" : "删除月度生产计划明细失败";
         log_message += "--标识:" + mtr_code;
         InsertTlog(log_message);
         bindGrid2(hidePlanID.Value);
         bindGrid1();
     }
     catch (Exception ee)
     {
         Response.Write(ee.Message);
     }
 }
Esempio n. 9
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();
            }
        }
    }
Esempio n. 10
0
    protected void btnDel1_Click(object sender, EventArgs e)
    {
        MSYS.DAL.DbOperator opt         = new MSYS.DAL.DbOperator();
        List <string>       commandlist = new List <string>();

        commandlist.Add("update HT_PUB_TECH_SECTION set IS_DEL = '1' where SECTION_CODE = '" + txtCode_1.Text + "'");
        //commandlist.Add("update ht_pub_inspect_process set IS_DEL = '1' where substr(PROCESS_CODE,1,5) = '" + txtCode.Text + "'");
        commandlist.Add("update HT_PUB_TECH_PARA set IS_DEL = '1' where substr(PARA_CODE,1,5) =  '" + txtCode_1.Text + "'");
        string log_message;

        if (opt.TransactionCommand(commandlist) == "Success")
        {
            log_message = "删除工艺段成功";
            tvHtml      = InitTree();
            opt.bindDropDownList(listSection_2, "select section_code,section_name from ht_pub_tech_section where is_del = '0' and is_valid = '1' order by section_code", "section_name", "section_code");
            opt.bindDropDownList(listSection, "select section_code,section_name from ht_pub_tech_section where is_valid = '1' and is_del = '0' order by section_code", "section_name", "section_code");
            string[] procseg    = { };
            object[] procvalues = { };
            opt.ExecProcedures("Create_Online_month_Report", procseg, procvalues);
            ScriptManager.RegisterStartupScript(UpdatePanel4, this.Page.GetType(), "sucess", "initTree();alert('删除成功');", true);
        }
        else
        {
            log_message = "删除工艺段失败";
        }
        log_message += ",工艺段ID:" + txtCode_1.Text;
        InsertTlog(log_message);
    }
Esempio n. 11
0
    protected void btnModify_Click(object sender, EventArgs e)
    {
        MSYS.DAL.DbOperator opt         = new MSYS.DAL.DbOperator();
        List <string>       commandlist = new List <string>();
        string log_message;

        if (txtPrdctdate.Text == "" || txtValiddate.Text == "" || (listStrgOut.SelectedValue == "" && txtStrgOut.Text == "") || listPrdct.SelectedValue == "" || DropDownListShift.SelectedValue == "" || DropDownListTeam.SelectedValue == "")
        {
            ScriptManager.RegisterStartupScript(UpdatePanel2, this.Page.GetType(), "alert", "alert('请输入必要信息!!')", true);
            return;
        }

        //生成领用主表记录
        string relationcode = (listStrgOut.SelectedValue == "") ? txtStrgOut.Text:listStrgOut.SelectedValue;

        string[] seg   = { "ORDER_SN", "OUT_DATE", "EXPIRED_DATE", "MODIFY_TIME", "WARE_HOUSE_ID", "DEPT_ID", "CREATOR_ID", "MONTHPLANNO", "RELATION_CODE", "STRG_TYPE", "team_code", "shift_code" };
        string[] value = { txtCode.Text, txtPrdctdate.Text, txtValiddate.Text, System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), listStorage.SelectedValue, listApt.SelectedValue, listCreator.SelectedValue, txtPlanno.Text, relationcode, "1", DropDownListTeam.SelectedValue.ToString(), DropDownListShift.SelectedValue.ToString() };

        commandlist.Add(opt.getMergeStr(seg, value, 1, "HT_STRG_COAT"));
        commandlist.Add("delete from HT_STRG_COAT_SUB where MAIN_CODE = '" + txtCode.Text + "'");
        //根据生产计划对应的配方明细生成原料领用明细
        commandlist.Add("insert into HT_STRG_COAT_SUB select strgcoat_id_seq.nextval,  r.mater_code,r.storage,r.original_demand,r.real_demand,r.remark,r.unit_code,'0',r.mater_flag,'" + txtCode.Text + "','','','',r.CLS_CODE,'','' from HT_STRG_COAT_SUB r where r.main_code = '" + relationcode + "'");
        log_message  = opt.TransactionCommand(commandlist) == "Success" ? "生成原料领用主表记录成功" : "生成原料领用主表记录失败";
        log_message += "--详情:" + string.Join(",", value);
        InsertTlog(log_message);


        bindGrid1();
        bindGrid2();
    }
Esempio n. 12
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);
        }
    }
Esempio n. 13
0
    protected void btnDelSel_Click(object sender, EventArgs e)
    {
        try
        {
            List <string>       commandlist = new List <string>();
            MSYS.DAL.DbOperator opt         = new MSYS.DAL.DbOperator();

            for (int i = 0; i < GridView2.Rows.Count; i++)
            {
                if (((CheckBox)GridView2.Rows[i].FindControl("ck_sel")).Checked)
                {
                    string mtr_code = GridView2.DataKeys[i].Value.ToString();
                    mtr_code = (mtr_code == "") ? " is null" :"='" + mtr_code + "'";
                    string prod_code = ((DropDownList)GridView2.Rows[i].FindControl("list_prod")).SelectedValue;
                    commandlist.Add("delete from HT_QLT_SENSOR_RECORD_SUB where main_id = '" + hideID.Value + "' and PROD_CODE = '" + prod_code + "' and record_time  " + mtr_code);
                }
            }
            string log_message = opt.TransactionCommand(commandlist) == "Success" ? "删除感观评测原始记录详情成功" : "删除感观评测原始记录详情失败";
            InsertTlog(log_message);
            bindGrid2(hideID.Value);
        }
        catch (Exception ee)
        {
            Response.Write(ee.Message);
        }
    }
Esempio n. 14
0
    protected void btnGridopt_Click(object sender, EventArgs e)//出库,调用接口,变更库存情况
    {
        Button btn    = (Button)sender;
        int    index  = ((GridViewRow)btn.NamingContainer).RowIndex;//获得行号
        string id     = GridView1.DataKeys[index].Values[0].ToString();
        string aprv   = ((Label)GridView1.Rows[index].FindControl("labAudit")).Text;
        string planno = GridView1.DataKeys[index].Values[1].ToString();

        if (aprv == "己通过")
        {
            List <string> commandlist = new List <string>();
            commandlist.Add("update HT_STRG_FLAVOR set ISSUE_STATUS = '1',ISSUER_ID ='" + ((MSYS.Data.SysUser)Session["User"]).id + "'  where ORDER_SN = '" + id + "'");
            commandlist.Add("update HT_PROD_MONTH_PLAN_DETAIL set  FLAVOR_STATUS = '2' where PLAN_NO = '" + planno + "' and FLAVOR_STATUS = '1'");
            MSYS.Web.StorageOpt st = new MSYS.Web.StorageOpt();
            ////调用接口,变更库存////
            string flag = st.XiangInOrOut(id, ((MSYS.Data.SysUser)Session["User"]).text, ((MSYS.Data.SysUser)Session["User"]).id);
            /////
            if (flag.Length > 9 && flag.Substring(0, 9) == "notenough")
            {
                ScriptManager.RegisterStartupScript(GridView1, this.GetType(), "scriptKey", "alert(‘物料不足" + flag.Substring(9) + "’)", true);
            }
            MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
            string log_message      = opt.TransactionCommand(commandlist) == "Success" ? "出入库成功" : "出入库失败";
            log_message += "--标识:" + id;
            InsertTlog(log_message);
            bindGrid1();
        }
        else
        {
            ScriptManager.RegisterStartupScript(UpdatePanel1, this.Page.GetType(), "", "alert('请通过审批后再出库');", true);
        }
    }
Esempio n. 15
0
    protected void btnCopy_Click(object sender, EventArgs e)
    {
        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        string  query           = "select * from HT_QLT_INSPECT_STDD_SUB where STDD_CODE = '" + listtech.SelectedValue + "' and is_del = '0'";
        DataSet data            = opt.CreateDataSetOra(query);

        if (data != null && data.Tables[0].Rows.Count > 0)
        {
            List <string> commandlist = new List <string>();
            foreach (DataRow row in data.Tables[0].Rows)
            {
                string[] seg   = { "STDD_CODE", "INSPECT_CODE", "MINUS_SCORE", "UPPER_VALUE", "LOWER_VALUE", "REMARK", "CREATE_ID", "CREATE_TIME" };
                string[] value = { listtechC.SelectedValue, row["INSPECT_CODE"].ToString(), row["MINUS_SCORE"].ToString(), row["UPPER_VALUE"].ToString(), row["LOWER_VALUE"].ToString(), row["REMARK"].ToString(), ((SysUser)Session["User"]).id, System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") };

                commandlist.Add(opt.getMergeStr(seg, value, 2, "HT_QLT_INSPECT_STDD_SUB"));
            }
            string log_message = opt.TransactionCommand(commandlist) == "Success" ? "复制标准成功" : "复制标准失败";
            log_message += ",复制标准:" + listtechC.SelectedValue;
            InsertTlog(log_message);
        }


        initView();
        bindGrid1();
        bindGrid2();
    }
Esempio n. 16
0
 protected void btnGridDel_Click(object sender, EventArgs e)//删除计划
 {
     try
     {
         List <string>       commandlist = new List <string>();
         MSYS.DAL.DbOperator opt         = new MSYS.DAL.DbOperator();
         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("delete from ht_prod_schedule  where ID = '" + id + "'");
             }
         }
         if (commandlist.Count > 0)
         {
             string log_message = opt.TransactionCommand(commandlist) == "Success" ? "删除排班成功" : "删除排班失败";
             InsertTlog(log_message);
             bindGrid2();
         }
     }
     catch (Exception ee)
     {
         Response.Write(ee.Message);
     }
 }
Esempio n. 17
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        string   Btime          = opt.GetSegValue("select begin_time from ht_sys_shift t where shift_name = '早班'", "begin_time");
        DateTime startdate      = Convert.ToDateTime(txtStartDate.Text + " " + Btime);
        DateTime enddate        = Convert.ToDateTime(txtEndDate.Text + " " + Btime).AddDays(1);

        if (listPrdline.SelectedValue == "" || txtStartDate.Text == "" || txtEndDate.Text == "" || startdate - enddate > new  TimeSpan(0) || enddate - System.DateTime.Now < new  TimeSpan(0))
        {
            ScriptManager.RegisterStartupScript(UpdatePanel1, this.Page.GetType(), "alert", "alert('请选择正确的排班车间与时间段!!')", true);
            return;
        }
        DateTime tempdate = GetMondayDate(startdate).AddDays(7);

        if (GridView1.Rows.Count > 0)
        {
            List <string> commandlist = new List <string>();

            List <TeamSchedula> schedules = getTeamSchedule();
            int h = 0;
            if (startdate - System.DateTime.Now < new TimeSpan(0))
            {
                startdate = System.DateTime.Now;
            }
            while (startdate < enddate)
            {
                if (h == 3)
                {
                    h = 0;
                }
                TeamSchedula schedule = schedules.ToArray()[h];
                while (startdate < tempdate && startdate <= enddate)
                {
                    for (int i = 0; i < GridView1.Rows.Count; i++)
                    {
                        string endtime = startdate.ToString("yyyy-MM-dd") + " " + ((TextBox)GridView1.Rows[i].FindControl("txtEndtime")).Text;
                        if (((CheckBox)GridView1.Rows[i].FindControl("ckInter")).Checked)
                        {
                            endtime = startdate.AddDays(1).ToString("yyyy-MM-dd") + " " + ((TextBox)GridView1.Rows[i].FindControl("txtEndtime")).Text;
                        }
                        string[] seg   = { "WORK_DATE", "WORK_SHOP_CODE", "SHIFT_CODE", "TEAM_CODE", "WORK_STAUS", "CREATE_TIME", "MODIFY_TIME", "DATE_BEGIN", "DATE_END", "is_del" };
                        string[] value = { startdate.ToString("yyyy-MM-dd"), listPrdline.SelectedValue, GridView1.DataKeys[i].Value.ToString(), schedule.team.ToArray()[i], "1", System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), startdate.ToString("yyyy-MM-dd") + " " + ((TextBox)GridView1.Rows[i].FindControl("txtStarttime")).Text, endtime, "0" };
                        if (((CheckBox)GridView1.Rows[i].FindControl("ckInter")).Checked)
                        {
                            startdate = startdate.AddDays(1);
                        }
                        commandlist.Add(opt.getMergeStr(seg, value, 3, "HT_PROD_SCHEDULE"));
                    }
                }
                h++;
                tempdate = tempdate.AddDays(7);
            }
            string log_message = opt.TransactionCommand(commandlist) == "Success" ? "排班成功" : "排班失败";
            log_message += ",排班时间:" + txtStartDate.Text + "~" + txtEndDate.Text;
            InsertTlog(log_message);
            ScriptManager.RegisterStartupScript(UpdatePanel1, this.Page.GetType(), "alert", "alert('" + log_message + "')", true);
        }
        bindGrid2();
    }
Esempio n. 18
0
    protected void btnModify_Click(object sender, EventArgs e)
    {
        MSYS.DAL.DbOperator opt         = new MSYS.DAL.DbOperator();
        List <string>       commandlist = new List <string>();
        string log_message;

        if (txtPrdctdate.Text == "" || txtValiddate.Text == "" || listPrdctPlan.SelectedValue == "" || listPrdct.SelectedValue == "" || DropDownListShift.SelectedValue == "" || DropDownListTeam.SelectedValue == "")
        {
            ScriptManager.RegisterStartupScript(UpdatePanel2, this.Page.GetType(), "alert", "alert('请输入必要信息!!')", true);
            return;
        }

        //生成领用主表记录
        string[] seg   = { "ORDER_SN", "OUT_DATE", "EXPIRED_DATE", "MODIFY_TIME", "WARE_HOUSE_ID", "DEPT_ID", "CREATOR_ID", "MONTHPLANNO", "BATCHNUM", "STRG_TYPE", "team_code", "shift_code" };
        string[] value = { txtCode.Text, txtPrdctdate.Text, txtValiddate.Text, System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), listStorage.SelectedValue, listApt.SelectedValue, listCreator.SelectedValue, listPrdctPlan.SelectedValue, txtBatchNum.Text, "0", DropDownListTeam.SelectedValue.ToString(), DropDownListShift.SelectedValue.ToString() };

        commandlist.Add(opt.getMergeStr(seg, value, 1, "HT_STRG_COAT"));
        commandlist.Add("delete from HT_STRG_COAT_SUB where MAIN_CODE = '" + txtCode.Text + "'");
        //根据生产计划对应的配方明细生成原料领用明细
        //   commandlist.Add("insert into HT_STRG_COAT_SUB  select '' as ID, g3.mater_code as MATER_CODE,g4.data_origin_flag as STORAGE,g3.batch_num*" + txtBatchNum.Text + " as ORIGINAL_DEMAND, '' as REAL_DEMAND,'' as Remark,g4.unit_code as UNIT_CODE , '0' as IS_DEL,g3.coat_flag as mater_flag,'" + txtCode.Text + "' as MAIN_CODE,'' as PACKNUM ,'' as SUBSTANCE, '' as ODDQTY ,g3.CLASS_NAME as cls_code from ht_prod_month_plan_detail g1 left join ht_pub_prod_design g2 on g1.prod_code = g2.prod_code left join HT_QA_COAT_FORMULA_detail g3 on g3.formula_code = g2.COAT_FORMULA_CODE and g3.is_del = '0' left join ht_pub_materiel g4 on g4.material_code = g3.mater_code where g1.plan_no = '" + listPrdctPlan.SelectedValue + "' and g3.mater_code is not null");
        //commandlist.Add("insert into HT_STRG_COAT_SUB  select '' as ID, g3.mater_code as MATER_CODE,g4.data_origin_flag as STORAGE,g3.batch_num*" + txtBatchNum.Text + " as ORIGINAL_DEMAND, '' as REAL_DEMAND,'' as Remark,g4.unit_code as UNIT_CODE , '0' as IS_DEL,g3.coat_flag as mater_flag,'" + txtCode.Text.Trim() + "' as MAIN_CODE,'' as PACKNUM ,'' as SUBSTANCE, '' as ODDQTY , '' as cls_code, '' as REMNANT, ''as PIECE_NUM from ht_prod_month_plan_detail g1 left join ht_pub_prod_design g2 on g1.prod_code = g2.prod_code left join HT_QA_COAT_FORMULA_detail g3 on g3.formula_code = g2.COAT_FORMULA_CODE and g3.is_del = '0' left join ht_pub_materiel g4 on g4.material_code = g3.mater_code where g1.plan_no = '" + listPrdctPlan.SelectedValue + "' and g3.mater_code is not null");
        commandlist.Add("insert into HT_STRG_COAT_SUB  select '' as ID, g3.mater_code as MATER_CODE,g4.data_origin_flag as STORAGE,g3.batch_num*1 as ORIGINAL_DEMAND, '' as REAL_DEMAND,'' as Remark,g4.unit_code as UNIT_CODE , '0' as IS_DEL,g3.coat_flag as mater_flag,'" + txtCode.Text.Trim() + "' as MAIN_CODE,'' as PACKNUM ,'' as SUBSTANCE, '' as ODDQTY , '' as cls_code, '' as REMNANT, ''as PIECE_NUM from ht_prod_month_plan_detail g1 left join ht_pub_prod_design g2 on g1.prod_code = g2.prod_code left join HT_QA_COAT_FORMULA_detail g3 on g3.formula_code = g2.COAT_FORMULA_CODE and g3.is_del = '0' left join ht_pub_materiel g4 on g4.material_code = g3.mater_code where g1.plan_no = '" + listPrdctPlan.SelectedValue + "' and g3.mater_code is not null");
        log_message  = opt.TransactionCommand(commandlist) == "Success" ? "生成原料领用主表记录成功" : "生成原料领用主表记录失败";
        log_message += "--详情:" + string.Join(",", value);
        InsertTlog(log_message);
        //////计算出入库单总各类型总量
        DataSet res = opt.CreateDataSetOra("select sum(t.original_demand) as amount ,t.mater_flag from HT_STRG_COAT_SUB t  where t.main_code = '" + txtCode.Text + "' group by  t.mater_flag");

        if (res != null && res.Tables[0].Rows.Count > 0)
        {
            double CABOSUM = 0, PEICESSUM = 0;
            foreach (DataRow row in res.Tables[0].Rows)
            {
                if (row["mater_flag"].ToString() == "HT")
                {
                    if (row["amount"].ToString() != "")
                    {
                        CABOSUM += Convert.ToDouble(row["amount"].ToString());
                    }
                }
                if (row["mater_flag"].ToString() == "LY")
                {
                    if (row["amount"].ToString() != "")
                    {
                        PEICESSUM += Convert.ToDouble(row["amount"].ToString());
                    }
                }
            }
            txtStemSum.Text = CABOSUM.ToString("0.00");
            txtChipSum.Text = PEICESSUM.ToString("0.00");
            string[] seg1   = { "ORDER_SN", "CABOSUM", "PEICESSUM" };
            string[] value1 = { txtCode.Text, txtStemSum.Text, txtChipSum.Text };
            opt.MergeInto(seg1, value1, 1, "HT_STRG_COAT");
        }

        bindGrid1();
        bindGrid2();
    }
Esempio n. 19
0
    protected void btnModify_Click(object sender, EventArgs e)
    {
        MSYS.DAL.DbOperator opt         = new MSYS.DAL.DbOperator();
        List <string>       commandlist = new List <string>();

        if (rd1.Checked)
        {
            if (listProd2.SelectedValue == "" || listPlanno.SelectedValue == "" || listTeam2.SelectedValue == "" || txtDate.Text == "")
            {
                ScriptManager.RegisterStartupScript(UpdatePanel1, this.Page.GetType(), "message", "alert('请录入完整的数据信息')", true);

                return;
            }
            else
            {
                MSYS.Data.SysUser user = (MSYS.Data.SysUser)Session["User"];
                string[]          seg  = { "PLANNO", "PROD_CODE", "SECTION_CODE", "TEAM", "TIME", "PARA_CODE", "CREATOR", "VALUE" };
                foreach (GridViewRow row in GridView2.Rows)
                {
                    string paravalue = ((TextBox)row.FindControl("txtParavalue")).Text;
                    string paracode  = ((DropDownList)row.FindControl("listPara")).SelectedValue;
                    if (((TextBox)row.FindControl("txtParavalue")).Text != "")
                    {
                        string[] value = { listPlanno.SelectedValue, listProd2.SelectedValue, paracode.Substring(0, 5), listTeam2.SelectedValue, txtDate.Text, paracode, user.text, paravalue };
                        commandlist.Add(opt.getMergeStr(seg, value, 6, "HT_PROD_REPORT_DETAIL"));
                    }
                }
            }
        }
        else
        {
            if (listProd2.SelectedValue == "" || listPlanno.SelectedValue == "")
            {
                ScriptManager.RegisterStartupScript(UpdatePanel1, this.Page.GetType(), "message", "alert('请录入完整的数据信息')", true);

                return;
            }
            else
            {
                foreach (GridViewRow row in GridView2.Rows)
                {
                    string   paravalue = ((TextBox)row.FindControl("txtParavalue")).Text;
                    string   paracode  = ((DropDownList)row.FindControl("listPara")).SelectedValue;
                    string[] seg       = { "SECTION_CODE", "PLANNO", GridView2.DataKeys[row.RowIndex].Value.ToString() };
                    string[] value     = { paracode.Substring(0, 5), listPlanno.SelectedValue, paravalue };
                    commandlist.Add(opt.getMergeStr(seg, value, 2, "HT_PROD_REPORT"));
                }
            }
        }

        string log_message = opt.TransactionCommand(commandlist) == "Success" ? "保存物料过程数据成功," : "保存物料过程数据失败,";

        log_message += "--详情产品:" + listProd2.SelectedValue + "计划号:" + listPlanno.SelectedValue + "班组:" + listTeam.SelectedValue + "日期:" + txtDate.Text;
        InsertTlog(log_message);
        ScriptManager.RegisterStartupScript(UpdatePanel1, this.Page.GetType(), "", " $('.shade').fadeOut(100);", true);
        bindGrid();
        bindGrid3();
    }
Esempio n. 20
0
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        MSYS.DAL.DbOperator opt         = new MSYS.DAL.DbOperator();
        List <String>       commandlist = new List <string>();

        commandlist.Add("delete HT_TECH_STDD_CODE  where TECH_CODE = '" + txtCode.Text + "'");
        commandlist.Add("delete from ht_pub_aprv_flowinfo where BUSIN_ID = '" + txtCode.Text + "'");
        string log_message = opt.TransactionCommand(commandlist) == "Success" ? "删除工艺标准成功" : "删除工艺标准失败";

        log_message += "--标识:" + txtCode.Text;
        InsertTlog(log_message);
        initView();
    }
Esempio n. 21
0
    protected void btnGrid2Modify_Click(object sender, EventArgs e)
    {
        try
        {
            MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
            foreach (GridViewRow row in GridView2.Rows)
            {
                int    Rowindex  = row.RowIndex;//获得行号
                string mtr_code  = ((TextBox)row.FindControl("txtPlanNo")).Text;
                string prod_code = ((DropDownList)row.FindControl("listProd")).SelectedValue;
                if (!Regex.IsMatch(hidePlanID.Value, @"^[+-]?/d*$"))
                {
                    hidePlanID.Value = hidePlanID.Value.Substring(hidePlanID.Value.LastIndexOf(',') + 1);
                }
                string path_code = opt.GetSegValue("select path_code from ht_pub_prod_design where prod_code = '" + prod_code + "'", "path_code");

                if (mtr_code == "" || mtr_code.Substring(8, 7) != prod_code)
                {
                    if (mtr_code.Length >= 17 && mtr_code.Substring(8, 7) != prod_code)
                    {
                        opt.UpDateOra("delete from ht_prod_month_plan_detail where plan_no = '" + mtr_code + "'");
                    }
                    string planno = opt.GetSegValue("select nvl(Max(substr(PLAN_NO,16,2)),0)+1 as CODE from ht_prod_month_plan_detail where month_plan_ID = '" + hidePlanID.Value + "'", "CODE");
                    mtr_code = "PD" + txtYear.Text + listMonth.SelectedValue + prod_code + planno.PadLeft(2, '0');
                }
                List <string> commandlist = new List <string>();
                string[]      seg         = { "plan_no", "MONTH_PLAN_ID", "plan_Sort", "prod_code", "plan_output", "path_code", "is_del" };
                string[]      value       = { mtr_code, hidePlanID.Value, ((TextBox)row.FindControl("txtOrder")).Text, prod_code, ((TextBox)row.FindControl("txtOutput")).Text, path_code, "0" };
                commandlist.Add(opt.getMergeStr(seg, value, 1, "HT_PROD_MONTH_PLAN_DETAIL"));
                if (hideAdjust.Value == "1")
                {
                    commandlist.Add("update HT_PROD_MONTH_PLAN set ADJUST_STATUS = '1',MODIFY_ID = '" + ((MSYS.Data.SysUser)Session["User"]).id + "' where ID = '" + hidePlanID.Value + "'");
                }

                string log_message = opt.TransactionCommand(commandlist) == "Success" ? "保存生产计划详情成功" : "生产计划详情失败";
                log_message += "--详情:" + string.Join(",", value);
                InsertTlog(log_message);

                if (path_code != " ")
                {
                    insertSectionPath(path_code, mtr_code);
                }
            }
            bindGrid2(hidePlanID.Value);
            bindGrid1();
        }
        catch (Exception ee)
        {
            Response.Write(ee.Message);
        }
    }
Esempio n. 22
0
    protected void btnDel_Click(object sender, EventArgs e)
    {
        MSYS.DAL.DbOperator opt         = new MSYS.DAL.DbOperator();
        List <String>       commandlist = new List <string>();

        commandlist.Add("delete from  ht_pub_path_prod  where pathcode = '" + listPathAll.SelectedValue + "'");
        commandlist.Add("delete from ht_pub_aprv_flowinfo where BUSIN_ID = '" + listPathAll.SelectedValue + "'");
        string log_message = opt.TransactionCommand(commandlist) == "Success" ? "删除全线路径成功" : "删除全线路径失败";

        log_message += "--标识:" + listPathAll.SelectedValue;
        InsertTlog(log_message);
        initView();
        bindGrid();
    }
Esempio n. 23
0
    protected void btnDel_Click(object sender, EventArgs e)
    {
        List <string> commandlist = new List <string>();

        commandlist.Add("update HT_PUB_PROD_DESIGN set IS_DEL = '1'  where PROD_CODE = '" + txtCode.Text + "'");

        commandlist.Add("delete from ht_pub_aprv_flowinfo where BUSIN_ID = '" + txtCode.Text + "'");
        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        string log_message      = opt.TransactionCommand(commandlist) == "Success" ? "删除产品信息成功" : "删除产品信息失败";

        log_message += ",产品编码:" + txtCode.Text;
        InsertTlog(log_message);
        bindGrid();
    }
Esempio n. 24
0
    protected void btnGrid3Save_Click(object sender, EventArgs e)
    {
        List <string> commandlist = new List <string>();

        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        foreach (GridViewRow row in GridView3.Rows)
        {
            string[] seg   = { "para_code", "PATH_CODE", "WEIGHT" };
            string[] value = { GridView3.DataKeys[row.RowIndex].Value.ToString(), listPathAll.SelectedValue, ((TextBox)row.FindControl("txtWeight")).Text };
            commandlist.Add(opt.getMergeStr(seg, value, 2, "HT_PUB_PARA_WEIGHT"));
        }
        string log_message = opt.TransactionCommand(commandlist) == "Success" ? "更改工艺点权重成功" : "更改工艺点权重失败";

        InsertTlog(log_message);
        ScriptManager.RegisterStartupScript(UpdatePanel3, this.Page.GetType(), "msg", "alert('" + log_message + "')", true);
    }
Esempio n. 25
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)
        {
            string[] seg   = { "ID", "Weight", "remark", "CREATE_ID", "CREATE_DATE", "is_adjust" };
            string[] value = { GridView2.DataKeys[row.RowIndex].Value.ToString(), ((TextBox)row.FindControl("txtWeight")).Text, ((TextBox)row.FindControl("txtRemark")).Text, ((MSYS.Data.SysUser)Session["User"]).id, System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), "1" };
            commandlist.Add(opt.getMergeStr(seg, value, 1, "HT_QLT_WEIGHT"));
        }
        string log_message = opt.TransactionCommand(commandlist) == "Success" ? "更改质量评估权重成功" : "更改质量评估权重失败";

        InsertTlog(log_message);
        ScriptManager.RegisterStartupScript(UpdatePanel2, this.Page.GetType(), "msg", "alert('" + log_message + "')", true);
    }
Esempio n. 26
0
    protected void btnSumit_Click(object sender, EventArgs e)
    {
        MSYS.DAL.DbOperator opt         = new MSYS.DAL.DbOperator();
        List <string>       commandlist = new List <string>();

        commandlist.Add("update HT_EQ_MT_PLAN_DETAIL set STATUS = '5',CONTENT = '故障己上报' where id = '" + txtCode.Text + "'");

        string[] seg   = { "EQUIPMENT_ID", "EXE_TIME", "RESPONER", "MECH_AREA", "IS_EMG", "REASON", "CONTENT", "STATUS" };
        string[] value = { listEq.SelectedValue, System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), listOptor.SelectedValue, listArea.SelectedValue, Convert.ToInt16(ckFault.Checked).ToString(), txtResults.Text, txtRecord.Text, "-1" };
        commandlist.Add(opt.InsertDatastr(seg, value, "HT_EQ_RP_PLAN_DETAIL"));
        string log_message = opt.TransactionCommand(commandlist) == "Success" ? "维保上报故障成功" : "维保上报故障失败";

        log_message += "--详情:" + string.Join(",", value);
        InsertTlog(log_message);
        bindGrid();
    }
Esempio n. 27
0
    protected void btnGrid1Save_Click(object sender, EventArgs e)
    {
        List <string> commandlist = new List <string>();

        MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
        foreach (GridViewRow row in GridView1.Rows)
        {
            string[] seg   = { "section_code", "Weight", "remark" };
            string[] value = { ((DropDownList)row.FindControl("listSection")).SelectedValue, ((TextBox)row.FindControl("txtWeight")).Text, ((TextBox)row.FindControl("txtRemark")).Text };
            commandlist.Add(opt.getMergeStr(seg, value, 1, "HT_PUB_TECH_SECTION"));
        }
        string log_message = opt.TransactionCommand(commandlist) == "Success" ? "更改工艺段权重成功" : "更改工艺段权重失败";

        InsertTlog(log_message);
        ScriptManager.RegisterStartupScript(UpdatePanel1, this.Page.GetType(), "msg", "alert('" + log_message + "')", true);
    }
Esempio n. 28
0
    protected void btnGrid1Del_Click(object sender, EventArgs e)
    {
        Button btn       = (Button)sender;
        int    rowIndex  = ((GridViewRow)btn.NamingContainer).RowIndex;
        string prod_code = GridView1.DataKeys[rowIndex].Value.ToString();

        MSYS.DAL.DbOperator opt         = new MSYS.DAL.DbOperator();
        List <String>       commandlist = new List <string>();

        commandlist.Add("update ht_pub_prod_design set is_del = '1' where PROD_CODE = '" + prod_code + "'");
        commandlist.Add("delete from ht_pub_aprv_flowinfo where BUSIN_ID = '" + prod_code + "'");
        string log_message = opt.TransactionCommand(commandlist) == "Success" ? "删除产品成功" : "删除产品失败";

        log_message += "--标识:" + prod_code;
        InsertTlog(log_message);
        bindGrid();
    }
Esempio n. 29
0
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        Button btn      = (Button)sender;
        int    rowIndex = ((GridViewRow)btn.NamingContainer).RowIndex;
        string id       = GridView1.DataKeys[rowIndex].Value.ToString();

        MSYS.DAL.DbOperator opt         = new MSYS.DAL.DbOperator();
        List <string>       commandlist = new List <string>();

        commandlist.Add("update  ht_inner_map  set is_del = '1' where MAPID = '" + id + "'");
        commandlist.Add("update ht_svr_sys_menu set IS_DEL = '1' where F_MAPID = '" + id + "'");
        string log_message = opt.TransactionCommand(commandlist) == "Success" ? "删除Map表映射成功" : "删除Map表映射失败";

        log_message += "--标识:" + id;
        InsertTlog(log_message);
        bindData();
    }
Esempio n. 30
0
    protected void btnCalbrt_Click(object sender, EventArgs e)
    {
        if (drpBatch.SelectedValue == "" || txtcalBtime.Text == "")
        {
            ScriptManager.RegisterStartupScript(UpdatePanel2, this.Page.GetType(), "message", "alert('请选择自动校准采样批次及采样时间!!')", true);
            return;
        }
        if (GridView2.Rows.Count > 0)
        {
            MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();

            List <string> commandlist = new List <string>();
            string        prod_code   = drpBatch.SelectedValue.Substring(8, 7);
            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")
                {
                    string para_code = ((DropDownList)row.FindControl("listGridPoint")).SelectedValue;
                    string setval    = opt.GetSegValue("select value from ht_tech_stdd_code_detail r  left join ht_pub_prod_design q on q.tech_stdd_code = r.tech_code  where r.para_code = '" + para_code + "' and q.prod_code = '" + prod_code + "'", "value");
                    setval = (setval == "NoRecord" ? "0" : setval);
                    string   resval = getResVal(txtcalBtime.Text, txtcalEtime.Text, para_code);
                    string[] seg    = { "ID", "OLDVALUE", "POINTVALUE", "SAMPLE_TIME", "remark", "STATUS" };

                    string[] value = { id, setval, resval, txtcalBtime.Text.Substring(0, 10), ((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();
                }
            }
        }
    }