Exemplo n.º 1
0
    protected void button1_onclick(object sender, EventArgs e)
    {
        ZWL.BLL.ERPOperations MyModel = new ZWL.BLL.ERPOperations();
        MyModel.AcceptPeople = ZWL.Common.PublicMethod.GetSessionValue("UserName");//truename  UserName
        MyModel.OrderNo      = this.OrderNo.Text.Trim();
        try
        {
            MyModel.Update_Accept();
            //写系统日志
            ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi();
            MyRiZhi.UserName    = ZWL.Common.PublicMethod.GetSessionValue("UserName");//UserName
            MyRiZhi.DoSomething = "运维受理,工单号(" + this.OrderNo + ")";
            MyRiZhi.IpStr       = System.Web.HttpContext.Current.Request.UserHostAddress.ToString();
            MyRiZhi.Add();

            ZWL.Common.MessageBox.ShowAndRedirect(this, "运维受理成功!", "Operations_accept.aspx");
        }
        catch
        {
            Response.Write("<script>alert('运维受理失败!');history.back(-1);</script>");
            Response.End();
        }
    }
Exemplo n.º 2
0
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        ZWL.BLL.ERPOperations Model = new ZWL.BLL.ERPOperations();
        string OrderNo = KNetOddNumbers();

        Model.OrderNo = OrderNo;

        if (String.IsNullOrEmpty(this.department2.Text) || String.IsNullOrEmpty(this.department1.Text))
        {
            Response.Write("<script>alert('运维受理失败!未选择科室!');history.back(-1);</script>");
            Response.End();
            return;
        }
        if (this.RepairCall.Text.Length < 4)
        {
            Response.Write("<script>alert('运维受理失败!报修电话格式错误!清填写正确');history.back(-1);</script>");
            Response.End();
            return;
        }

        Model.RepairDepartment = this.department2.Text.ToString();//this.RepairDepartment.Text.ToString();
        Model.RepairPeople     = this.RepairPeople.Text.ToString();
        Model.FauleEquipment   = this.YuanBianHao.Text.ToString();
        Model.EquipmentType    = this.EquipmentType.Text.ToString();
        Model.EquipmentName    = this.EquipmentName.Text.ToString();
        Model.XingHao          = this.XingHao.Text.ToString();
        Model.CunFangAddr      = this.CunFangAddr.Text.ToString(); // CunFangAddr 字段用作 维修地址
        Model.RepairCall       = this.RepairCall.Text.ToString();  //RepairCall 报修电话 20180110
        string faulttext = String.Format("{0}->{1}", this.FaultClassification.SelectedItem.Text, this.FaultType1.SelectedItem.Text);

        Model.FaultClassification = faulttext;//FaultClassification 故障分类 20180911

        try
        {
            Model.FauleDate = DateTime.Parse(this.FaultDate.Text.Trim());
        }
        catch { }
        Model.Phenomenon         = this.Phenomenon.Text.ToString();
        Model.RepairDate         = DateTime.Now;
        Model.State              = "0";
        Model.RegistrationPeople = ZWL.Common.PublicMethod.GetSessionValue("UserName");

        if (Model.Add1().Equals(1))
        {
            Response.Write("<script>alert('添加派工记录失败!');history.back(-1);</script>");
            Response.End();
        }
        String  ID   = "";
        DataSet data = Model.GetID(OrderNo);

        for (int i = 0; i < data.Tables[0].Rows.Count; i++)
        {
                 {
                ID = data.Tables[0].Rows[i]["ID"].ToString();
                    
            }
        }



        //写系统日志
        ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi();
        MyRiZhi.UserName    = ZWL.Common.PublicMethod.GetSessionValue("UserName");
        MyRiZhi.DoSomething = "运维报修,单号为:(" + OrderNo + ")";
        MyRiZhi.IpStr       = System.Web.HttpContext.Current.Request.UserHostAddress.ToString();
        MyRiZhi.Add();

        //直接受理单号
        ZWL.BLL.ERPOperations MyModel = new ZWL.BLL.ERPOperations();
        MyModel.AcceptPeople = ZWL.Common.PublicMethod.GetSessionValue("UserName");//truename  UserName
        MyModel.OrderNo      = OrderNo.Trim();
        try
        {
            MyModel.Update_Accept();
            //写系统日志
            ZWL.BLL.ERPRiZhi MyRZ = new ZWL.BLL.ERPRiZhi();
            MyRZ.UserName    = ZWL.Common.PublicMethod.GetSessionValue("UserName");//UserName
            MyRZ.DoSomething = "运维受理,工单号(" + OrderNo + ")";
            MyRZ.IpStr       = System.Web.HttpContext.Current.Request.UserHostAddress.ToString();
            MyRZ.Add();

            //ZWL.Common.MessageBox.ShowAndRedirect(this, "运维受理成功!", "Operations_accept.aspx");
        }
        catch
        {
            Response.Write("<script>alert('运维受理失败!');history.back(-1);</script>");
            Response.End();
        }
        //跳转派工界面
        String codestr = "<script language='javascript'>window.open('dispatching.aspx?ID=";

        codestr += ID + "','_self');</script>";
        Response.Write(codestr);

        ZWL.Common.MessageBox.ShowAndRedirect(this, "故障申报成功,我们将会尽快安排工程师为您解决,请耐心等候!", "Repair.aspx");
    }