예제 #1
0
 protected void btn_Save_Click(object sender, EventArgs e)
 {
     //提交项目
     //保存项目信息项目
     Entity.AccessReport entity    = new Entity.AccessReport();
     DAl.Report          reportobj = new DAl.Report();
     //生成文号
     entity.ReportNO   = "";                                                   //t_报告编号
     entity.CreateDate = DateTime.Now;                                         //创建时间
     entity.CreateUser = Request.Cookies["Cookies"].Values["u_id"].ToString(); //创建人
     entity.StatusID   = 5;                                                    //提交
     entity.backflag   = 0;
     entity.Content    = txt_Content.Text.TrimEnd();
     entity.ID         = int.Parse(strReportId);
     entity.hcs        = txt_cs.Text.Trim();
     entity.hfwdw      = txt_fwdw.Text.Trim();
     if (reportobj.UpateYShanFinish(entity) == 1)
     {
         WebApp.Components.Log.SaveLog("函编制保存成功!", Request.Cookies["Cookies"].Values["u_id"].ToString(), 5);
         ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "clickAddSuccess", "hiddenDetail();alert('函保存成功!')", true);
     }
     else
     {
         WebApp.Components.Log.SaveLog("函编制保存失败!", Request.Cookies["Cookies"].Values["u_id"].ToString(), 5);
         ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "clickAddFail", "alert('函保存失败!')", true);
     }
     Query();
 }
예제 #2
0
    protected void btn_back_Click(object sender, EventArgs e)
    {
        //保存项目信息项目
        Entity.AccessReport entity    = new Entity.AccessReport();
        DAl.Report          reportobj = new DAl.Report();

        //方案编写保存
        entity.ReportNO   = "";                                                   //
        entity.CreateDate = DateTime.Now;                                         //创建时间
        entity.CreateUser = Request.Cookies["Cookies"].Values["u_id"].ToString(); //创建人
        entity.StatusID   = 3.5;                                                  //保存
        entity.backflag   = 1;
        entity.Remark     = txt_Remark4.Text.Trim();
        entity.ID         = int.Parse(strReportId);

        if (reportobj.UpateYSReport(entity) == 1)
        {
            WebApp.Components.Log.SaveLog("报告编制退回保存成功!", Request.Cookies["Cookies"].Values["u_id"].ToString(), 4);



            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "clickAddSuccess", "hiddenDetail();alert('报告编制退回保存成功!')", true);
        }
        else
        {
            WebApp.Components.Log.SaveLog("报告编制退回保存失败!", Request.Cookies["Cookies"].Values["u_id"].ToString(), 4);
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "clickAddFail", "alert('报告编制退回保存失败!')", true);
        }
        Query();
    }
예제 #3
0
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        string strFlag = Verify();

        if (strFlag != "")
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "click", "alert('" + strFlag + "');", true);
            // return;
        }
        else
        {
            Entity.AccessReport entity = new Entity.AccessReport();

            entity.CreateDate = DateTime.Now;                                         //创建时间
            entity.CreateUser = Request.Cookies["Cookies"].Values["u_id"].ToString(); //创建人

            entity.Remark = txt_remark2.Text.Trim();                                  //备注
            if (rbl_tkwether.SelectedValue.ToString() == "1")
            {
                entity.tkflag   = 1;
                entity.StatusID = 3;
            }
            else
            {
                entity.tkflag   = 0;
                entity.StatusID = 3;
            }
            entity.backflag = 0;
            DAl.Report reportobj = new DAl.Report();
            entity.Green = 0;

            entity.ID = int.Parse(strReportId);
            if (reportobj.UpateYStk(entity) == 1)
            {
                WebApp.Components.Log.SaveLog("踏勘提交成功!", Request.Cookies["Cookies"].Values["u_id"].ToString(), 5);
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "clickAddSuccess", "hiddenDetail();alert('数据提交成功!')", true);
            }
            else
            {
                WebApp.Components.Log.SaveLog("踏勘提交失败!", Request.Cookies["Cookies"].Values["u_id"].ToString(), 5);
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "clickAddFail", "alert('数据添保存失败!')", true);
            }
        }
        Query();
    }
예제 #4
0
    //提交
    protected void grdvw_List_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
    {
        strReportId = grdvw_List.Rows[e.NewSelectedIndex].Cells[1].Text.Trim();
        Entity.AccessReport entity    = new Entity.AccessReport();
        DAl.Report          reportobj = new DAl.Report();
        DataTable           dt        = reportobj.Get(int.Parse(strReportId));

        entity.CreateDate = DateTime.Now;                                         //创建时间
        entity.CreateUser = Request.Cookies["Cookies"].Values["u_id"].ToString(); //创建人
        entity.StatusID   = 3.5;
        entity.backflag   = 0;
        entity.Green      = 0;
        entity.WTDate     = DateTime.Parse(dt.Rows[0]["ReportAccessDate"].ToString()); //委托日期
        entity.classID    = int.Parse(dt.Rows[0]["rwclass"].ToString());               //委托任务

        entity.WTMan   = dt.Rows[0]["wtdepart"].ToString();;                           //委托单位
        entity.lxEmail = dt.Rows[0]["lxemail"].ToString();
        entity.lxMan   = dt.Rows[0]["lxman"].ToString();
        entity.lxtel   = dt.Rows[0]["lxtel"].ToString();
        entity.address = dt.Rows[0]["address"].ToString();

        entity.chargeman   = dt.Rows[0]["chargeman"].ToString();   //项目负责人
        entity.level       = dt.Rows[0]["Ulevel"].ToString();      //紧急程度
        entity.Mode        = dt.Rows[0]["jcmethod"].ToString();    //监测方式
        entity.Content     = dt.Rows[0]["varremark3"].ToString();  //备注
        entity.WTNO        = dt.Rows[0]["ReportName"].ToString();  //委托协议编码,报告标识
        entity.ProjectName = dt.Rows[0]["Projectname"].ToString(); //项目名称
        entity.TypeID      = int.Parse(dt.Rows[0]["ItemType"].ToString());
        //rwclass,CreateDate,UserID,ReportAccessDate,ItemType,ReportName,Ulevel,urgent,wtdepart,lxman,lxtel,lxemail,address,jcmethod,Projectname,StatusID,chargeman
        entity.ID = int.Parse(strReportId);
        if (reportobj.UpateYSfanAn(entity) == 1)
        {
            WebApp.Components.Log.SaveLog("方案编制保存成功!", Request.Cookies["Cookies"].Values["u_id"].ToString(), 5);
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "clickAddSuccess", "hiddenDetail();alert('数据保存成功!')", true);
        }
        else
        {
            WebApp.Components.Log.SaveLog("方案编制保存失败!", Request.Cookies["Cookies"].Values["u_id"].ToString(), 5);
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "clickAddFail", "alert('数据添保存失败!')", true);
        }
        Query();
    }
예제 #5
0
    protected void btn_OK_Click(object sender, EventArgs e)
    {
        string strFlag = Verify();

        if (strFlag != "")
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "click", "alert('" + strFlag + "');", true);
            // return;
        }
        else
        {
            Entity.AccessReport entity = new Entity.AccessReport();

            entity.CreateDate = DateTime.Now;                                         //创建时间
            entity.CreateUser = Request.Cookies["Cookies"].Values["u_id"].ToString(); //创建人

            entity.ReportNO = txt_ReportNO.Text.Trim();
            entity.Remark   = txt_Remark4.Text.Trim();

            entity.backflag = 0;
            DAl.Report reportobj = new DAl.Report();


            entity.ID = int.Parse(strReportId);
            if (reportobj.UpateYSReport(entity) == 1)
            {
                WebApp.Components.Log.SaveLog("报告编制保存成功!", Request.Cookies["Cookies"].Values["u_id"].ToString(), 5);
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "clickAddSuccess", "hiddenDetail();alert('数据保存成功!')", true);
            }
            else
            {
                WebApp.Components.Log.SaveLog("报告编制编辑失败!", Request.Cookies["Cookies"].Values["u_id"].ToString(), 5);
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "clickAddFail", "alert('数据添保存失败!')", true);
            }
        }
        Query();
    }
예제 #6
0
    protected void btn_OK_Click(object sender, EventArgs e)
    {
        string strFlag = Verify();

        if (strFlag != "")
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "click", "alert('" + strFlag + "');", true);
            return;
        }
        else
        {
            string compay = "0";
            string cyman  = "0";

            //获取采样人,现场分析人
            DAl.User.Users    userobj = new DAl.User.Users();
            Entity.User.Users user    = null; //= new Entity.User.Users();
            user = userobj.GetUsers(txt_xmfzr.Text.Trim());
            if (user != null)
            {
                cyman = user.UserID.ToString();
            }
            else
            {
                if (rbl_wether.SelectedValue.ToString() == "0")
                {
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "click", "alert('系统不存在项目负责人/报告编制人,请核实!');", true);
                    return;
                }
            }
            Entity.AccessReport entity = new Entity.AccessReport();
            entity.classID = int.Parse(drop_rwtype.SelectedValue.ToString());//任务类型

            compay = txt_wtdepart.Text.Trim();
            if (ck_fa.Checked)
            {
                entity.hanwether = "1";
            }
            else
            {
                entity.hanwether = "0";
            }
            entity.WTMan   = compay;//委托单位
            entity.lxEmail = txt_lxemail.Text.Trim();
            entity.lxMan   = txt_lxman.Text.Trim();;
            entity.lxtel   = txt_lxtel.Text.Trim();;
            entity.address = txt_address.Text.Trim();

            entity.CreateDate = DateTime.Now;                                         //创建时间
            entity.CreateUser = Request.Cookies["Cookies"].Values["u_id"].ToString(); //创建人
            entity.WTDate     = DateTime.Parse(txt_CreateDate.Text.Trim());           //委托日期,任务接收日期
            entity.chargeman  = cyman;                                                //项目负责人
            //entity.level = drop_level.SelectedValue.ToString();//紧急程度
            entity.Mode        = drop_mode.SelectedValue.ToString();                  //监测方式
            entity.Remark      = drop_urgent.Text.Trim();                             //备注
            entity.WTNO        = txt_ReportID.Text.Trim();                            //委托协议编码,报告标识
            entity.ProjectName = txt_Projectname.Text.Trim();                         //项目名称
            entity.TypeID      = int.Parse(drop_ItemList.SelectedValue.ToString().Trim());


            entity.CreateDate = DateTime.Now;                                         //创建时间
            entity.CreateUser = Request.Cookies["Cookies"].Values["u_id"].ToString(); //创建人

            entity.chargeman = cyman;                                                 //项目负责人
            entity.level     = drop_level.SelectedValue.ToString();                   //紧急程度
            // entity.Mode = drop_mode.SelectedValue.ToString();//监测方式
            //if (rbl_wether.SelectedValue.ToString() == "0")
            //{
            //    entity.csflag = 0;

            //}
            //else
            //{
            //    entity.csflag = 1;

            //}
            entity.StatusID = 6;
            entity.Remark   = txt_remak1.Text.Trim();//备注

            DAl.Report reportobj = new DAl.Report();
            entity.StatusID = 1;
            entity.ID       = int.Parse(strReportId);
            if (reportobj.UpateYSzp(entity) == 1)
            {
                WebApp.Components.Log.SaveLog("创建样品原单编辑成功!", Request.Cookies["Cookies"].Values["u_id"].ToString(), 5);
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "clickAddSuccess", "hiddenDetail();alert('数据保存成功!')", true);
            }
            else
            {
                WebApp.Components.Log.SaveLog("创建样品原单编辑失败!", Request.Cookies["Cookies"].Values["u_id"].ToString(), 5);
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "clickAddFail", "hiddenDetail();alert('数据添保存失败!')", true);
            }
        }
        Query();
    }
예제 #7
0
    protected void btn_OK_Click(object sender, EventArgs e)
    {
        string strFlag = Verify();

        if (strFlag != "")
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "click", "alert('" + strFlag + "');", true);
            // return;
        }
        else
        {
            string compay = "0";
            string cyman  = "0";

            ////获取采样人,现场分析人
            //DAl.User.Users userobj = new DAl.User.Users();
            //Entity.User.Users user = null;//= new Entity.User.Users();
            //user = userobj.GetUsers(txt_xmfzr.Text.Trim());
            //if (user != null)
            //{
            //    cyman = user.UserID.ToString();
            //}
            //else
            //{
            //    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "click", "alert('系统不存在项目负责人/报告编制人,请核实!');", true);
            //    return;
            //}
            Entity.AccessReport entity = new Entity.AccessReport();
            entity.classID = int.Parse(drop_rwtype.SelectedValue.ToString()); //任务类型
            if (entity.classID == 1)                                          //委托任务
            {
                DAl.Station stationobj = new DAl.Station();
                DataTable   dtstation  = stationobj.GetStationByName(txt_wtdepart.Text.Trim());

                if (dtstation.Rows.Count > 0)
                {
                    compay = dtstation.Rows[0]["id"].ToString();
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "click", "alert('系统不存在该委托单位,请核实!');", true);
                    return;
                }
                entity.WTMan   = compay;//委托单位
                entity.lxEmail = txt_lxemail.Text.Trim();
                entity.lxMan   = txt_lxman.Text.Trim();;
                entity.lxtel   = txt_lxtel.Text.Trim();;
                entity.address = txt_address.Text.Trim();
            }
            entity.CreateDate  = DateTime.Now;                                         //创建时间
            entity.CreateUser  = Request.Cookies["Cookies"].Values["u_id"].ToString(); //创建人
            entity.WTDate      = DateTime.Parse(txt_CreateDate.Text.Trim());           //委托日期,任务接收日期
            entity.chargeman   = cyman;                                                //项目负责人
            entity.level       = drop_level.SelectedValue.ToString();                  //紧急程度
            entity.Mode        = drop_mode.SelectedValue.ToString();                   //监测方式
            entity.Remark      = drop_urgent.Text.Trim();                              //备注
            entity.WTNO        = txt_ReportID.Text.Trim();                             //委托协议编码,报告标识
            entity.ProjectName = txt_Projectname.Text.Trim();                          //项目名称
            entity.TypeID      = int.Parse(drop_ItemList.SelectedValue.ToString().Trim());
            DAl.Report reportobj = new DAl.Report();
            entity.StatusID = 0;
            #region 添加新纪录
            if (strReportId == "" || strReportId == "0")
            {
                if (reportobj.AddYS(entity) == 1)
                {
                    btn_Save.Visible = true;
                    WebApp.Components.Log.SaveLog("创建任务单添加成功!", Request.Cookies["Cookies"].Values["u_id"].ToString(), 5);
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "click", "alert('任务创建成功!')", true);

                    //ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "clickAddSuccess", "hiddenDetail();alert('数据添加成功!')", true);
                }
                else
                {
                    WebApp.Components.Log.SaveLog("创建任务单添加失败!", Request.Cookies["Cookies"].Values["u_id"].ToString(), 5);
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "clickAddFail", "alert('数据添加失败!')", true);
                }
            }
            #endregion
            else
            {
                entity.ID = int.Parse(strReportId);
                if (reportobj.UpateYS(entity) == 1)
                {
                    WebApp.Components.Log.SaveLog("创建任务单编辑成功!", Request.Cookies["Cookies"].Values["u_id"].ToString(), 5);
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "clickAddSuccess", "hiddenDetail();alert('数据保存成功!')", true);
                }
                else
                {
                    WebApp.Components.Log.SaveLog("创建任务单编辑失败!", Request.Cookies["Cookies"].Values["u_id"].ToString(), 5);
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "clickAddFail", "hiddenDetail();alert('数据添保存失败!')", true);
                }
            }
        }
        Query();
    }
예제 #8
0
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        string strFlag = Verify();

        if (strFlag != "")
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "click", "alert('" + strFlag + "');", true);
            return;
        }
        else
        {
            string compay = "0";
            string cyman  = "0";

            Entity.AccessReport entity = new Entity.AccessReport();
            entity.classID = int.Parse(drop_rwtype.SelectedValue.ToString());//任务类型

            compay = txt_wtdepart.Text.Trim();

            entity.WTMan   = compay;  //委托单位
            entity.lxEmail = txt_lxemail.Text.Trim();
            entity.lxMan   = txt_lxman.Text.Trim();;
            entity.lxtel   = txt_lxtel.Text.Trim();;
            entity.address = txt_address.Text.Trim();

            entity.CreateDate = DateTime.Now;                                         //创建时间
            entity.CreateUser = Request.Cookies["Cookies"].Values["u_id"].ToString(); //创建人
            entity.WTDate     = DateTime.Parse(txt_CreateDate.Text.Trim());           //委托日期,任务接收日期
            entity.chargeman  = cyman;                                                //项目负责人
            //entity.level = drop_level.SelectedValue.ToString();//紧急程度
            entity.Mode        = drop_mode.SelectedValue.ToString();                  //监测方式
            entity.Remark      = drop_urgent.Text.Trim();                             //备注
            entity.WTNO        = txt_ReportID.Text.Trim();                            //委托协议编码,报告标识
            entity.ProjectName = txt_Projectname.Text.Trim();                         //项目名称
            entity.TypeID      = int.Parse(drop_ItemList.SelectedValue.ToString().Trim());
            DAl.Report reportobj = new DAl.Report();
            entity.StatusID = 1;
            #region 添加新纪录
            if (strReportId == "" || strReportId == "0")
            {
                if (reportobj.AddYS(entity) == 1)
                {
                    WebApp.Components.Log.SaveLog("综合室受理提交成功!", Request.Cookies["Cookies"].Values["u_id"].ToString(), 5);
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "click", "hiddenDetail();alert('任务创建成功!')", true);

                    //ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "clickAddSuccess", "hiddenDetail();alert('数据添加成功!')", true);
                }
                else
                {
                    WebApp.Components.Log.SaveLog("综合室受理提交失败!", Request.Cookies["Cookies"].Values["u_id"].ToString(), 5);
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "clickAddFail", "alert('数据添加失败!')", true);
                }
            }
            #endregion
            else
            {
                entity.ID = int.Parse(strReportId);
                if (reportobj.UpateYS(entity) == 1)
                {
                    WebApp.Components.Log.SaveLog("综合室受理保存成功!", Request.Cookies["Cookies"].Values["u_id"].ToString(), 5);
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "clickAddSuccess", "hiddenDetail();alert('数据保存成功!')", true);
                }
                else
                {
                    WebApp.Components.Log.SaveLog("综合室受理保存失败!", Request.Cookies["Cookies"].Values["u_id"].ToString(), 5);
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "clickAddFail", "hiddenDetail();alert('数据添保存失败!')", true);
                }
            }
            //entity.ID=int.Parse(strReportId);
            //           if (reportobj.UpateYS(entity)==1)

            //           {
            //               WebApp.Components.Log.SaveLog("创建样品原单编辑成功!", Request.Cookies["Cookies"].Values["u_id"].ToString(), 5);
            //               ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "clickAddSuccess", "hiddenDetail();alert('数据保存成功!')", true);


            //           }
            //           else
            //           {
            //               WebApp.Components.Log.SaveLog("创建样品原单编辑失败!", Request.Cookies["Cookies"].Values["u_id"].ToString(), 5);
            //               ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "clickAddFail", "hiddenDetail();alert('数据添保存失败!')", true);

            //           }
        }
        Query();
    }