protected void button1_onclick(object sender, EventArgs e) { ZWL.BLL.ERPOperations MyModel1 = new ZWL.BLL.ERPOperations(); MyModel1.OrderNo = this.OrderNo.Text.Trim(); MyModel1.ResultPeople = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyModel1.Msituation = this.Msituation.Text.Trim(); MyModel1.Completion = this.wcqk.SelectedValue.Trim(); MyModel1.Faulttype = this.gzlx.SelectedValue.Trim(); ZWL.BLL.ERPUser model = new ZWL.BLL.ERPUser(); model.UserName = this.headpeople.Text.Trim() + "','" + this.AssistPeople1.Text.Trim() + "','" + this.AssistPeople2.Text.Trim(); try { model.UpdateForname_zt(0); MyModel1.Update_Result(); //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "运维结果登记,工单号(" + this.OrderNo.Text.Trim() + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); ZWL.Common.MessageBox.ShowAndRedirect(this, "运维结果登记成功!", "Operations_registration_result.aspx"); } catch { Response.Write("<script>alert('运维结果登记失败!');history.back(-1);</script>"); Response.End(); } }
/// <summary> /// 获取记录数据 /// </summary> protected void Get_Knet_Suppliers_ByID() { ZWL.BLL.ERPOperations MyModel = new ZWL.BLL.ERPOperations(); if (Request["ID"] != null && Request["ID"] != "") { int ID = int.Parse(Request.QueryString["ID"].ToString().Trim()); if (MyModel.Exists(ID) == true) { MyModel.GetModel(ID); this.OrderNo.Text = MyModel.OrderNo; this.RepairDepartment.Text = MyModel.RepairDepartment; this.RepairPeople.Text = MyModel.RepairPeople; this.FauleEquipment.Text = MyModel.FauleEquipment; this.Phenomenon.Text = MyModel.Phenomenon; this.XingHao.Text = MyModel.XingHao; this.CunFangAddr.Text = MyModel.CunFangAddr; this.EquipmentName.Text = MyModel.EquipmentName; this.EquipmentType.Text = MyModel.EquipmentType; this.RepairDate.Text = MyModel.RepairDate.ToString(); this.FauleDate.Text = MyModel.FauleDate.ToString(); } else { Response.Write("<script language=javascript>alert('该维修记录已不存在!');window.close();</script>"); Response.End(); } } else { Response.Write("<script language=javascript>alert('非法参数!');window.close();</script>"); Response.End(); } }
protected void button1_onclick(object sender, EventArgs e) { ZWL.BLL.ERPOperations MyModel1 = new ZWL.BLL.ERPOperations(); MyModel1.OrderNo = this.OrderNo.Text.Trim(); MyModel1.Rejected = this.Rejectedtxt.Text.ToString(); MyModel1.RejectedPeople = ZWL.Common.PublicMethod.GetSessionValue("UserName"); try { MyModel1.Update_Rejected(); //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "运维驳回,工单号(" + this.OrderNo.Text.Trim() + ")"; 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(); } }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { ZWL.BLL.ERPOperations Model = new ZWL.BLL.ERPOperations(); string OrderNo = KNetOddNumbers(); Model.OrderNo = OrderNo; Model.RepairDepartment = 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(); try { Model.FauleDate = DateTime.Parse(this.FaultDate.Text.Trim()); } catch { } Model.Phenomenon = this.Phenomenon.Text.ToString(); Model.RepairDate = DateTime.Now; Model.State = "0"; Model.Add(); //写系统日志 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.Common.MessageBox.ShowAndRedirect(this, "故障申报成功,我们将会尽快安排工程师为您解决,请耐心等候!", "Repair.aspx"); }
protected void button1_onclick(object sender, EventArgs e) { String Headnamestr = ""; String Assist1str = ""; String Assist2str = ""; ZWL.BLL.ERPOperations MyModel1 = new ZWL.BLL.ERPOperations(); try { if (!this.HeadPeople.SelectedValue.Equals("")) { Headnamestr = this.HeadPeople.SelectedItem.ToString().Trim(); } if (!this.AssistPeople1.SelectedValue.Equals("")) { Assist1str = this.AssistPeople1.SelectedItem.ToString().Trim(); } if (!this.AssistPeople2.SelectedValue.Equals("")) { Assist2str = this.AssistPeople2.SelectedItem.ToString().Trim(); } } catch { } ZWL.BLL.ERPUser MyModel2 = new ZWL.BLL.ERPUser(); MyModel2.UserName = this.HeadPeople.SelectedValue.Trim() + ":" + Headnamestr; //this.HeadPeople.SelectedIndex.ToString(); ZWL.BLL.ERPUser MyModel3 = new ZWL.BLL.ERPUser(); MyModel3.UserName = this.AssistPeople1.SelectedValue.Trim() + ":" + Assist1str + "','" + this.AssistPeople2.SelectedValue.Trim() + ":" + Assist2str; MyModel1.OrderNo = this.OrderNo.Text.Trim(); MyModel1.DispatchingPeople = ZWL.Common.PublicMethod.GetSessionValue("username"); MyModel1.HeadPeople = this.HeadPeople.SelectedValue.Trim() + ":" + Headnamestr; MyModel1.AssistPeople1 = this.AssistPeople1.SelectedValue.Trim() + ":" + Assist1str; MyModel1.AssistPeople2 = this.AssistPeople2.SelectedValue.Trim() + ":" + Assist2str; try { MyModel1.Update_Technician(); MyModel2.Update_zt(1); MyModel3.Update_zt(2); //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("username"); MyRiZhi.DoSomething = "运维派工,工单号(" + this.OrderNo.Text.Trim() + ";" + MyModel2.UserName + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); ZWL.Common.MessageBox.ShowAndRedirect(this, "运维派工成功!", "Operations_dispatching.aspx"); //跳转回保修界面 Response.Redirect("registration.aspx"); //this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "this", "<script>history.go(-2);</script>"); } catch { Response.Write("<script>alert('运维派工失败!');history.back(-1);</script>"); Response.End(); } }
//<summary> //获取记录数据 //</summary> protected void Get_Knet_Suppliers_ByID() { ZWL.BLL.ERPOperations MyModel = new ZWL.BLL.ERPOperations(); string[] HeadPeople = { "" }; string[] AssistPeople1 = { "" }; string[] AssistPeople2 = { "" }; if (Request["ID"] != null && Request["ID"] != "") { int ID = int.Parse(Request.QueryString["ID"].ToString().Trim()); if (MyModel.Exists(ID) == true) { MyModel.GetModel(ID); this.OrderNo.Text = MyModel.OrderNo; this.RepairDepartment.Text = MyModel.RepairDepartment; this.RepairPeople.Text = MyModel.RepairPeople; this.FauleEquipment.Text = MyModel.FauleEquipment; this.Phenomenon.Text = MyModel.Phenomenon; this.XingHao.Text = MyModel.XingHao; this.CunfangAddr.Text = MyModel.CunFangAddr; this.EquipmentName.Text = MyModel.EquipmentName; this.EquipmentType.Text = MyModel.EquipmentType; this.repairdate.Text = MyModel.RepairDate.ToString(); this.FauleDate.Text = MyModel.FauleDate.ToString(); try { HeadPeople = MyModel.HeadPeople.Split(':'); AssistPeople1 = MyModel.AssistPeople1.Split(':'); AssistPeople2 = MyModel.AssistPeople2.Split(':'); } catch { } this.HeadPeople.Text = HeadPeople[1] + ' ' + AssistPeople1[0] + ' ' + AssistPeople2[0];//MyModel.HeadPeople+' '+MyModel.AssistPeople1+' '+MyModel.AssistPeople2; this.DispatchingPeople.Text = MyModel.DispatchingPeople; this.DispatchingDate.Text = MyModel.DispatchingDate.ToString(); this.Orderdate.Text = MyModel.OrderDate.ToString(); this.RepairCall.Text = MyModel.RepairCall.ToString(); } else { Response.Write("<script language=javascript>alert('该维修记录已不存在!');window.close();</script>"); Response.End(); } } else { Response.Write("<script language=javascript>alert('非法参数!');window.close();</script>"); Response.End(); } }
public void DataBindToGridview(string IDList) { ZWL.BLL.ERPOperations MyModel = new ZWL.BLL.ERPOperations(); if (IDList.Trim().Length > 0) { GVData.DataSource = MyModel.GetList(" " + DropDownList2.SelectedItem.Value.ToString() + " like '%" + this.TextBox3.Text.Trim() + "%' and ID in(" + IDList + ") order by ID desc"); } else { GVData.DataSource = MyModel.GetList(" " + DropDownList2.SelectedItem.Value.ToString() + " like '%" + this.TextBox3.Text.Trim() + "%' order by ID desc"); } GVData.DataBind(); LabPageSum.Text = Convert.ToString(GVData.PageCount); LabCurrentPage.Text = Convert.ToString(((int)GVData.PageIndex + 1)); this.GoPage.Text = LabCurrentPage.Text.ToString(); }
protected void button1_onclick(object sender, EventArgs e) { ZWL.BLL.ERPOperations MyModel1 = new ZWL.BLL.ERPOperations(); MyModel1.OrderNo = this.OrderNo.Text.Trim(); MyModel1.ReturnPeople = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyModel1.ReturnReason = this.returnreason.SelectedValue.Trim(); ZWL.BLL.ERPUser model = new ZWL.BLL.ERPUser(); model.UserName = this.headpeople.Text.Trim() + "','" + this.AssistPeople1.Text.Trim() + "','" + this.AssistPeople2.Text.Trim(); try { MyModel1.Update_Return(); model.Update_zt(0); string NewOrderNo = KNetOddNumbers(); using (SqlConnection conn = new SqlConnection(ConfigurationManager.AppSettings["SQLConnectionString"].ToString())) { SqlCommand cmd = new SqlCommand("insert into ERPOperations(OrderNo,FauleEquipment,Phenomenon,RepairDepartment,RepairPeople,FauleDate,RepairDate,State,EquipmentType,EquipmentName,XingHao,CunFangAddr) select " + NewOrderNo + ",FauleEquipment,Phenomenon,RepairDepartment,RepairPeople,FauleDate,RepairDate,0,EquipmentType,EquipmentName,XingHao,CunFangAddr from ERPOperations where orderno='" + MyModel1.OrderNo + "'", conn); conn.Open(); cmd.ExecuteNonQuery(); conn.Close(); } //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "运维转单,工单号(" + this.OrderNo.Text.Trim() + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); ZWL.Common.MessageBox.ShowAndRedirect(this, "运维转单成功!", "Operations_registration_result.aspx"); } catch { Response.Write("<script>alert('运维转单失败!');history.back(-1);</script>"); Response.End(); } }
/// <summary> /// 获取记录数据 /// </summary> protected void Get_Knet_Suppliers_ByID() { ZWL.BLL.ERPOperations MyModel = new ZWL.BLL.ERPOperations(); if (Request["ID"] != null && Request["ID"] != "") { int ID = int.Parse(Request.QueryString["ID"].ToString().Trim()); if (MyModel.Exists(ID) == true) { String [] Headname_str = { "" }; String[] AssistPeople1_str = { "" }; String[] AssistPeople2_str = { "" }; MyModel.GetModel(ID); try { Headname_str = MyModel.HeadPeople.Split(':'); AssistPeople1_str = MyModel.AssistPeople1.Split(':'); AssistPeople2_str = MyModel.AssistPeople2.Split(':'); } catch { } this.OrderNo.Text = MyModel.OrderNo; this.RepairDepartment.Text = MyModel.RepairDepartment; this.RepairPeople.Text = MyModel.RepairPeople; this.FauleEquipment.Text = MyModel.FauleEquipment; this.Phenomenon.Text = MyModel.Phenomenon; this.XingHao.Text = MyModel.XingHao; this.CunFangAddr.Text = MyModel.CunFangAddr; this.EquipmentName.Text = MyModel.EquipmentName; this.EquipmentType.Text = MyModel.EquipmentType; this.RepairDate.Text = MyModel.RepairDate.ToString(); this.FauleDate.Text = MyModel.FauleDate.ToString(); if (Headname_str.Length > 1) { this.headpeople.Text = Headname_str[1]; } else { this.headpeople.Text = MyModel.HeadPeople; } if (AssistPeople1_str.Length > 1) { this.AssistPeople1.Text = AssistPeople1_str[1]; } else { this.AssistPeople1.Text = MyModel.AssistPeople1; } if (AssistPeople2_str.Length > 1) { this.AssistPeople2.Text = AssistPeople2_str[1]; } else { this.AssistPeople2.Text = MyModel.AssistPeople2; } } else { Response.Write("<script language=javascript>alert('该维修记录已不存在!');window.close();</script>"); Response.End(); } } else { Response.Write("<script language=javascript>alert('非法参数!');window.close();</script>"); Response.End(); } }
/// <summary> /// 搜索 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void SeachKeyTextChanged(object sender, EventArgs e) { string SeachKeyContent = this.SeachKey.Text.ToString(); //string SeachKeyContent = SeachKey.Text.ToString().Substring(2, 4); using (SqlConnection conn = new SqlConnection(ConfigurationManager.AppSettings["SQLConnectionString"].ToString())) { conn.Open(); string Dostr = "SELECT * FROM ERPUser where department='临床工程信息部' and jiaose like '%维修%' and serils='" + SeachKeyContent + "' "; SqlCommand cmd = new SqlCommand(Dostr, conn); SqlDataReader dr = cmd.ExecuteReader(); //判断是否为维修员 if (dr.Read()) { string SeachKeyContent1 = this.SeachKey.Text.ToString(); String[] SeachKey = SeachKeyContent1.Split(':');//提取工号 Response.AddHeader("Refresh", "0"); using (SqlConnection conn1 = new SqlConnection(ConfigurationManager.AppSettings["SQLConnectionString"].ToString())) { conn1.Open(); string Dostr1 = "select * from ERPOperations where state='2' or state='3' and headpeople like '%" + SeachKey[0] + "%'"; // YU SqlCommand cmd1 = new SqlCommand(Dostr1, conn1); SqlDataReader dr1 = cmd1.ExecuteReader(); if (dr1.Read()) { ZWL.BLL.ERPOperations MyModel = new ZWL.BLL.ERPOperations(); MyModel.OrderNo = dr1["OrderNo"].ToString(); ZWL.BLL.ERPUser MyModel1 = new ZWL.BLL.ERPUser(); MyModel1.UserName = dr1["HeadPeople"].ToString();// ZWL.BLL.ERPUser MyModel2 = new ZWL.BLL.ERPUser(); MyModel2.UserName = dr1["AssistPeople1"].ToString() + "','" + dr1["AssistPeople2"].ToString(); try { MyModel.Update_Order(); MyModel1.Update_zt(3); MyModel2.Update_zt(4); //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "运维接单,工单号(" + MyModel.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(); } //Response.Write("<script>window.open('Knet_Procure_OpenBilling_PrinterPage.aspx?orderno=" + dr1["OrderNo"].ToString() + "','_blank')</script>"); Response.Write("<script>window.open('Operations_Print.aspx?ID=" + dr1["ID"].ToString() + "','_blank')</script>"); Response.End(); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "message", "<script language=javascript> window.alert('无新任务或正在维修中!');</script>"); } } } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "message", "<script language=javascript> window.alert('对不起,您不是维修员或录入的卡号有误!');</script>"); } } }
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"); }