public HttpResponseMessage PostNewBombaTicaOrder([FromBody] Order value) { OrderRegister.GetInstance().AddOrder(OrderRegister.orderListB, value); var response = Request.CreateResponse(HttpStatusCode.Created); return(response); }
//行绑定 protected void GridTest_RowDataBound(object sender, GridRowEventArgs e) { OrderRegister _register = e.DataItem as OrderRegister; e.Values[3] = _register.IsGroup ? "组合" : "项目"; e.Values[4] = _register.Isactive == "1" ? "正常" : "已停测试"; }
public IHttpActionResult GetBombaTicaOrderById(int id) { var val = OrderRegister.GetInstance().GetOrder(OrderRegister.orderListB, id); if (val == null) { return(NotFound()); } return(Ok(val)); }
///删除,停做组合|项目 protected void GridTest_RowCommand(object sender, ExtAspNet.GridCommandEventArgs e) { List <OrderRegister> _gridtestList = GetGridTest(true); GridRow row = GridTest.Rows[e.RowIndex]; OrderRegister _register = _gridtestList.Where <OrderRegister>(c => c.Id == Convert.ToDouble(row.Values[0])).First <OrderRegister>(); if (e.CommandName == "Delete") { if (!_register.Isdelete) { MessageBoxShow("此项目账单已出,不允许删除,请停止测试"); return; } var deletename = "[" + _register.Code + "]" + _register.Name; var strname = ""; if (_register.IsProduct) { deletename = _register.Productname; for (var i = 0; i < _gridtestList.Count; i++) { if (i == e.RowIndex) { continue; } OrderRegister temp = _gridtestList[i]; if (temp.IsProduct && temp.Productname == deletename) { strname += "[" + temp.Code + "]" + temp.Name + ","; temp.Productid = null; temp.Productname = string.Empty; } } } deletename += ","; tbxItemTest.Text = tbxItemTest.Text.Replace(deletename, strname).Replace(",,", ","); _gridtestList.Remove(_register); } else if (e.CommandName == "Stop") { if (_register.Isactive == "1") { row.Values[4] = "停止测试"; _register.Isactive = "0"; } else { GridTest.Rows[e.RowIndex].Values[4] = "正常"; _register.Isactive = "1"; } } BindGridTest(_gridtestList); }
public HttpResponseMessage PutPhischelOrder(int id, [FromBody] Order value) { var val = OrderRegister.GetInstance().UpdateOrder(OrderRegister.orderListP, id, value); if (val == false) { var responseA = Request.CreateResponse(HttpStatusCode.NotModified); return(responseA); } var responseB = Request.CreateResponse(HttpStatusCode.Accepted); return(responseB); }
public HttpResponseMessage DeleteBombaTicaRole(int id) { var val = OrderRegister.GetInstance().RemoveOrder(OrderRegister.orderListB, id); if (val == false) { var responseA = Request.CreateResponse(HttpStatusCode.NotModified); return(responseA); } var responseB = Request.CreateResponse(HttpStatusCode.Accepted); return(responseB); }
//行绑定 protected void GridTest_RowDataBound(object sender, GridRowEventArgs e) { OrderRegister _register = e.DataItem as OrderRegister; System.Web.UI.WebControls.DropDownList ddlcustomer = (System.Web.UI.WebControls.DropDownList)GridTest.Rows[e.RowIndex].FindControl("DropSendCustomer"); //绑定数据 BindDropSendCustomer(ddlcustomer); ddlcustomer.SelectedValue = _register.Sendoutcustomerid.ToString(); e.Values[3] = _register.IsGroup ? "组合" : "项目"; e.Values[4] = _register.Isactive == "1" ? "正常" : "已停测试"; if (_register.Sendbilled == "1") { ddlcustomer.Enabled = false; } }
///保存 protected void BtnSave_Click(object sender, EventArgs e) { GridRowCollection GridRow = GridTest.Rows; double?memberid = null; if (tbxmemberID.Text != string.Empty) { memberid = Convert.ToDouble(tbxmemberID.Text); } //获取系统时间时间 DateTime?date = loginservice.GetServerTime(); DateTime?datebirthday = null; int year = 0, month = 0, day = 0, hour = 0;//年月日时 double customerid; //验证 string msg = SaveCheck(date, out datebirthday, out year, out month, out day, out hour, out customerid); if (msg != string.Empty) { MessageBoxShow(msg); return; } List <Dicttestitem> grouptestList = new List <Dicttestitem>(); //订单中组合集合 List <Dicttestitem> productList = new List <Dicttestitem>(); //订单中套餐集合 ///实验室分点 double labid = Convert.ToDouble(DropDictLab.SelectedValue); List <Dicttestgroupdetail> TestGroupDetailList = loginservice.GetLoginDicttestgroupdetail();//组合项目字典 //获取集合 //List<OrderRegister> l = ViewState["GridTest"] as List<OrderRegister>; List <OrderRegister> _gridtestList = GetGridTest(true); //MessageBoxShow(l.Count.ToString() + "\t" + GridRow.Count.ToString()); //return; //已接收的条码号 string ReceivedBarcode = string.Empty; #region >>>> zhouy 获取订单中 组合,套餐 for (int i = 0; i < _gridtestList.Count; i++) { OrderRegister item = _gridtestList[i]; if (item.IsProduct)///套餐 去套餐ID和套餐名 { ///---------------------添加套餐------------------------------------- ///不包含此套餐才添加 if (productList.Where(c => c.Dicttestitemid == item.Productid).Count() <= 0) { Dicttestitem _product = registerserver.SelectsTestItemListById(item.Productid); productList.Add(_product); } ///----------------------end添加套餐------------------------------------- } else { Dicttestitem _product = registerserver.SelectsTestItemListById(item.Id); productList.Add(_product); } if ((Convert.ToInt32(item.Status)) >= ((int)daan.service.common.ParamStatus.OrderbarcodeStatus.Received)) { ReceivedBarcode += item.Barcode + ','; //continue; } string str = registerserver.checkSex(item.Id, DropSex.SelectedValue); if (str != string.Empty) { MessageBoxShow(str); return; } Dicttestitem _groupitem; ///添加组合|项目 _groupitem = new Dicttestitem(); _groupitem = registerserver.SelectsTestItemListById(item.Id); _groupitem.IsActive = item.Isactive; //是否停止测试 _groupitem.Isadd = item.Isadd; ///是否追加 _groupitem.Billed = item.Billed; _groupitem.Sendbilled = item.Sendbilled; _groupitem.Adduserid = item.Adduserid;///追加人ID _groupitem.Sendoutcustomerid = item.Sendoutcustomerid; _groupitem.Tubegroup = item.Tubegroup; _groupitem.Barcode = item.Barcode; _groupitem.Productid = item.Productid; _groupitem.Productname = item.Productname;///套餐名 grouptestList.Add(_groupitem); } #endregion #region >>>> zhouy 会员信息 Dictmember _member = new Dictmember(); _member.Realname = tbxName.Text.Trim(); _member.Idnumber = tbxIDNumber.Text == string.Empty ? "" : tbxIDNumber.Text; //检查会员 string errstr = registerserver.checkmember(memberid, ref _member); if (errstr != string.Empty) { MessageBoxShow(errstr); return; } _member.Nickname = tbxName.Text; _member.Sex = DropSex.SelectedValue; _member.Birthday = datebirthday; _member.Addres = tbxAddres.Text; _member.Phone = tbxPhone.Text; _member.Mobile = tbxMobile.Text; _member.Email = tbxEMail.Text; _member.Islock = "F";///是否锁定 #endregion #region >>>> zhouy insert Orders Orders order = registerserver.SelectOrderInfo(tbxOrderNum.Text); Orders _orders = order.Copy <Orders>(); _orders.Ordernum = tbxOrderNum.Text; ///体检流水号 _orders.Remarks = tbxRemark.Text; ///备注 _orders.Dictmemberid = _member.Dictmemberid; ///会员ID _orders.Dictcustomerid = customerid; ///所属客户ID _orders.Realname = _member.Nickname; _orders.Sex = _member.Sex; ///性别 对应INITBASIC表 _orders.Caculatedage = AgeToHour(year, month, day, hour); ///计算后的年龄(小时为单位) _orders.Age = string.Format("{0}岁{1}月{2}日{3}时", year, month, day, hour);; ///年龄字符串拼接 年月日时 _orders.Ordertestlst = tbxItemTest.Text; ///项目清单(冗余字段) _orders.Dictlabid = labid; ///实验室分点 _orders.Ordersource = "1"; _orders.Ismarried = radlIsMarried.SelectedValue; ///婚否 _orders.Section = tbxSection.Text; ///部门 _orders.Lastupdatedate = date; //最后更新时间 //省市区 _orders.Province = dpProvince.SelectedValue == "-1"?"":dpProvince.SelectedText; _orders.City = dpCity.SelectedValue == "-1" ? "" : dpCity.SelectedText; _orders.County = dpCounty.SelectedValue == "-1" ? "" : dpCounty.SelectedText; //邮寄信息 _orders.ContactNumber = txtCONTACTNUMBER.Text.Trim(); _orders.Recipient = txtRECIPIENT.Text.Trim(); _orders.PostAddress = txtPostAddress.Text.Trim(); //营业区 _orders.Area = txtArea.Text.Trim(); _orders.AccountManager = tbxAccountmanager.Text.Trim(); //采样日期 DateTime?spdate = null; if (dtSampleDate.Text != "") { spdate = Convert.ToDateTime(dtSampleDate.Text); } _orders.SamplingDate = spdate; #endregion string Content = string.Empty; ContrastObject(ref Content, _orders, order, _member); //是否有条码被物流接收 bool isreceived = ReceivedBarcode.TrimEnd(',') != string.Empty; string error = ""; bool b = registerserver.insertUpdateOrders("订单修改", Content, false, productList, grouptestList, _member, _orders, ReceivedBarcode.TrimEnd(','), ref error); if (b) { if (isreceived && (Content.Contains("年龄") || Content.Contains("性别")))//物流接受 则需要提示通知 { MessageBoxShow("该订单标本已被实验室接收,修改了年龄或者性别,请通知实验室"); } PageContext.RegisterStartupScript(ActiveWindow.GetHideReference()); } else { MessageBoxShow("保存失败:" + error); } }
///保存 protected void BtnSave_Click(object sender, EventArgs e) { GridRowCollection GridRow = GridTest.Rows; if (barcodeservice.CheckBarCode(tbxbarcode1.Text.Trim()))//条码号存在 { MessageBoxShow(string.Format("此条码号[{0}]已在本系统内生成,请更改条码号!", this.tbxbarcode1.Text.Trim())); return; } double?memberid = null; if (tbxmemberID.Text != string.Empty) { memberid = Convert.ToDouble(tbxmemberID.Text); } ///获取系统时间时间 DateTime?date = loginservice.GetServerTime(); DateTime?datebirthday = null; int year = 0, month = 0, day = 0, hour = 0;//年月日时 double customerid; //验证会员信息 string msg = SaveCheck(date, out datebirthday, out year, out month, out day, out hour, out customerid); if (msg != string.Empty) { MessageBoxShow(msg); return; } List <Dicttestitem> grouptestList = new List <Dicttestitem>(); //订单中组合集合 List <Dicttestitem> productList = new List <Dicttestitem>(); //订单中套餐集合 ///实验室分点 double labid = Convert.ToDouble(DropDictLab.SelectedValue); List <Dicttestgroupdetail> TestGroupDetailList = loginservice.GetLoginDicttestgroupdetail();//组合项目字典 //获取集合 List <OrderRegister> _gridtestList = GetGridTest(true); #region >>>> zhouy 获取订单中 组合,套餐 for (int i = 0; i < _gridtestList.Count; i++) { OrderRegister item = _gridtestList[i]; //判断性别是否符合 string str = registerserver.checkSex(item.Id, DropSex.SelectedValue); if (str != string.Empty) { MessageBoxShow(str); return; } Dicttestitem _groupitem; ///添加组合|项目 _groupitem = new Dicttestitem(); _groupitem = registerserver.SelectsTestItemListById(item.Id); _groupitem.IsActive = item.Isactive; //是否停止测试 _groupitem.Isadd = item.Isadd; ///是否追加 _groupitem.Billed = item.Billed; _groupitem.Sendbilled = item.Sendbilled; _groupitem.Adduserid = item.Adduserid;///追加人ID _groupitem.Sendoutcustomerid = item.Sendoutcustomerid; _groupitem.Tubegroup = item.Tubegroup; _groupitem.Barcode = item.Barcode; if (item.IsProduct)///套餐 去套餐ID和套餐名 { _groupitem.Productid = item.Productid; _groupitem.Productname = item.Productname;///套餐名 ///---------------------添加套餐------------------------------------- ///不包含此套餐才添加 if (productList.Where(c => c.Dicttestitemid == item.Productid).Count() <= 0) { Dicttestitem _product = registerserver.SelectsTestItemListById(item.Productid); productList.Add(_product); } ///----------------------end添加套餐------------------------------------- } else { Dicttestitem _product = registerserver.SelectsTestItemListById(item.Id); productList.Add(_product); } grouptestList.Add(_groupitem); } #endregion #region >>>> zhouy 会员信息 Dictmember member = new Dictmember(); member.Realname = tbxName.Text; member.Idnumber = tbxIDNumber.Text; //检查会员 string errstr = registerserver.checkmember(memberid, ref member); if (errstr != string.Empty) { MessageBoxShow(errstr); return; } member.Nickname = tbxName.Text; member.Sex = DropSex.SelectedValue; member.Birthday = datebirthday; member.Addres = tbxAddres.Text; member.Mobile = tbxMobile.Text; member.Email = tbxEMail.Text; member.Islock = "F";///是否锁定 #endregion #region >>>> zhouy insert Orders Orders _orders = new Orders(); _orders.Ordernum = tbxOrderNum.Text; ///体检流水号 _orders.Remarks = tbxRemark.Text; ///备注 _orders.Dictmemberid = member.Dictmemberid; ///会员ID _orders.Dictcustomerid = customerid; ///所属客户ID _orders.Realname = member.Nickname; _orders.Sex = member.Sex; ///性别 对应INITBASIC表 _orders.Caculatedage = AgeToHour(year, month, day, hour); ///计算后的年龄(小时为单位) _orders.Age = string.Format("{0}岁{1}月{2}日{3}时", year, month, day, hour);; ///年龄字符串拼接 年月日时 _orders.Enterby = Userinfo.userName; ///录入人 _orders.Ordertestlst = tbxItemTest.Text; ///项目清单(冗余字段) _orders.Dictlabid = labid; ///实验室分点 //_orders.Ordersource = radlCustomerType.SelectedValue; _orders.Ordersource = "1"; //默认单位 _orders.Ismarried = radlIsMarried.SelectedValue; ///婚否 _orders.Section = tbxSection.Text; ///部门 _orders.Createdate = date; //_orders.Provincename = dpProvince.SelectedValue == "-1" ? "" : dpProvince.SelectedText; //_orders.Cityname = dpCity.SelectedValue == "-1" ? "" : dpCity.SelectedText; //_orders.Countyname = dpCounty.SelectedValue == "-1" ? "" : dpCounty.SelectedText; #endregion string error = ""; bool b = registerserver.insertUpdateOrders("体检登记", "", true, productList, grouptestList, member, _orders, "", ref error); if (b) { clearData(true); } else { MessageBoxShow("保存失败:" + error); } }
///保存 protected void BtnSave_Click(object sender, EventArgs e) { GridRowCollection GridRow = GridTest.Rows; double?memberid = null; if (tbxmemberID.Text != string.Empty) { memberid = Convert.ToDouble(tbxmemberID.Text); } ///获取系统时间时间 DateTime?date = loginservice.GetServerTime(); DateTime?datebirthday = null; int year = 0, month = 0, day = 0, hour = 0;//年月日时 double customerid; //验证 string msg = SaveCheck(date, out datebirthday, out year, out month, out day, out hour, out customerid); if (msg != string.Empty) { MessageBoxShow(msg); return; } List <Dicttestitem> grouptestList = new List <Dicttestitem>(); //订单中组合集合 List <Dicttestitem> productList = new List <Dicttestitem>(); //订单中套餐集合 ///实验室分点 double labid = Convert.ToDouble(tbxDictLab.Label); List <Dicttestgroupdetail> TestGroupDetailList = loginservice.GetLoginDicttestgroupdetail();//组合项目字典 //获取集合 List <OrderRegister> _gridtestList = GetGridTest(true); //已接收的条码号 string ReceivedBarcode = string.Empty; #region >>>> zhouy 获取订单中 组合,套餐 for (int i = 0; i < _gridtestList.Count; i++) { OrderRegister item = _gridtestList[i]; if (item.IsProduct)///套餐 取套餐ID和套餐名 { ///---------------------添加套餐------------------------------------- ///不包含此套餐才添加 if (productList.Where(c => c.Dicttestitemid == item.Productid).Count() <= 0) { Dicttestitem _product = registerserver.SelectsTestItemListById(item.Productid); productList.Add(_product); } ///----------------------end添加套餐------------------------------------- } else { Dicttestitem _product = registerserver.SelectsTestItemListById(item.Id); productList.Add(_product); } if ((Convert.ToInt32(item.Status)) >= ((int)daan.service.common.ParamStatus.OrderbarcodeStatus.Received)) { ReceivedBarcode += item.Barcode + ','; // continue; } string str = registerserver.checkSex(item.Id, tbxSex.Label); if (str != string.Empty) { MessageBoxShow(str); return; } Dicttestitem _groupitem; ///添加组合|项目 _groupitem = new Dicttestitem(); _groupitem = registerserver.SelectsTestItemListById(item.Id); _groupitem.IsActive = item.Isactive; //是否停止测试 _groupitem.Isadd = item.Isadd; ///是否追加 _groupitem.Billed = item.Billed; _groupitem.Sendbilled = item.Sendbilled; _groupitem.Adduserid = item.Adduserid;///追加人ID _groupitem.Sendoutcustomerid = item.Sendoutcustomerid; _groupitem.Tubegroup = item.Tubegroup; _groupitem.Barcode = item.Barcode; ////if (item.IsProduct)///套餐 取套餐ID和套餐名 ////{ _groupitem.Productid = item.Productid; _groupitem.Productname = item.Productname;///套餐名 ////} grouptestList.Add(_groupitem); } #endregion #region >>>> zhouy insert Orders Orders order = registerserver.SelectOrderInfo(tbxOrderNum.Text); Orders _orders = order.Copy <Orders>(); _orders.Ordernum = tbxOrderNum.Text; ///体检流水号 _orders.Remarks = tbxRemark.Text; ///备注 _orders.Dictmemberid = Convert.ToDouble(tbxmemberID.Text); ///会员ID _orders.Dictcustomerid = customerid; ///所属客户ID _orders.Realname = tbxName.Text; _orders.Sex = tbxSex.Label; ///性别 对应INITBASIC表 _orders.Caculatedage = AgeToHour(year, month, day, hour); ///计算后的年龄(小时为单位) _orders.Age = string.Format("{0}岁{1}月{2}日{3}时", year, month, day, hour);; ///年龄字符串拼接 年月日时 //_orders.Enterby = Userinfo.userName;///录入人 修改时不变 _orders.Ordertestlst = tbxItemTest.Text; ///项目清单(冗余字段) _orders.Dictlabid = labid; ///实验室分点 _orders.Ordersource = "1"; _orders.Ismarried = radlIsMarried.SelectedValue; ///婚否 _orders.Section = tbxSection.Text; ///部门 _orders.Lastupdatedate = date; // _orders.Createdate = date; #endregion string content = string.Empty; if (tbxItemTest.Label != tbxItemTest.Text) { content += string.Format("项目清单:[{0}]更改为[{1}],", tbxItemTest.Label, tbxItemTest.Text); } bool isreceived = ReceivedBarcode.TrimEnd(',') != string.Empty; string error = ""; bool b = registerserver.insertUpdateOrders("追加项目", content, false, productList, grouptestList, null, _orders, ReceivedBarcode.TrimEnd(','), ref error); #region >>>> zhouy 执行结果 手续操作 if (b) { PageContext.RegisterStartupScript(ActiveWindow.GetHideReference()); } else { MessageBoxShow("保存失败:" + error); } #endregion }
public List <Order> GetAllBombaTicaOrders() { return(OrderRegister.GetInstance().GetAllOrders(OrderRegister.orderListB)); }
public List <Order> GetAllPhischelOrders() { return(OrderRegister.GetInstance().GetAllOrders(OrderRegister.orderListP)); }