string type = String.Empty; // 对象类型 protected void Page_Load(object sender, EventArgs e) { op = RequestData.Get <string>("op"); id = RequestData.Get <string>("id"); type = RequestData.Get <string>("type"); IList <string> entStrList = RequestData.GetList <string>("data"); InWarehouse ent = null; switch (RequestActionString) { case "create": ent = this.GetPostedData <InWarehouse>(); ent.State = "未入库"; ent.InWarehouseNo = DataHelper.QueryValue("select SHHG_AimExamine.dbo.fun_getInWarehouseNo()").ToString(); ent.CreateId = UserInfo.UserID; ent.CreateName = UserInfo.Name; ent.CreateTime = System.DateTime.Now; ent.DoCreate(); ProcessDetail(entStrList, ent); //添加其他入库详情 break; case "update": ent = this.GetMergedData <InWarehouse>(); ent.DoUpdate(); OtherInWarehouseDetail.DeleteAll("InWarehouseId='" + ent.Id + "'"); ProcessDetail(entStrList, ent); //添加其他入库详情 break; case "batchdelete": DoBatchDelete(); break; default: DoSelect(); break; } if (op != "c" && op != "cs") { if (!String.IsNullOrEmpty(id)) { string sql = @"select A.*,C.Name from SHHG_AimExamine..InWarehouse as A left join SHHG_AimExamine..Warehouse as C on A.WarehouseId=C.Id where A.Id='{0}'"; sql = string.Format(sql, id); IList <EasyDictionary> Dics = DataHelper.QueryDictList(sql); if (Dics.Count > 0) { this.SetFormData(Dics[0]); } } } else { //添加的时候自动生成入库单流水号 PageState.Add("InWarehouseNo", DataHelper.QueryValue("select SHHG_AimExamine.dbo.fun_getInWarehouseNo()")); } }
protected void Page_Load(object sender, EventArgs e) { op = RequestData.Get <string>("op"); id = RequestData.Get <string>("id"); if (!string.IsNullOrEmpty(id)) { ent = ReturnOrder.Find(id); } switch (RequestActionString) { case "update": ent = GetMergedData <ReturnOrder>(); ent.DoUpdate(); break; case "create": ent = this.GetPostedData <ReturnOrder>(); ent.Number = DataHelper.QueryValue("select SHHG_AimExamine.dbo.fun_getReturnOrderNumber()") + ""; //自动生成流水号 ent.State = "已生成"; ent.DoCreate(); soent = SaleOrder.FindAllByProperty("Number", ent.OrderNumber).FirstOrDefault <SaleOrder>(); soent.ReturnAmount = (soent.ReturnAmount.HasValue ? soent.ReturnAmount.Value : 0) + ent.ReturnMoney; soent.DoUpdate(); //将退货金额反写到销售单 if (soent.InvoiceState == "已全部开发票") { ent.IsDiscount = "T"; ent.DoUpdate(); } InWarehouse inwh = new InWarehouse { PublicInterface = ent.Id, //退货单Id InWarehouseNo = DataHelper.QueryValue("select SHHG_AimExamine.dbo.fun_getInWarehouseNo()").ToString(), InWarehouseType = "退货入库", WarehouseId = ent.WarehouseId, WarehouseName = ent.WarehouseName, State = "未入库" }; inwh.DoCreate(); ProcessDetail(inwh); break; case "GetSaleOrderPart": string orderNumber = RequestData.Get <string>("OrderNumber"); soent = SaleOrder.FindAllByProperty("Number", orderNumber).FirstOrDefault <SaleOrder>(); PageState.Add("Result", OrdersPart.FindAllByProperty(OrdersPart.Prop_OId, soent.Id)); break; default: DoSelect(); break; } }
string type = String.Empty; // 对象类型 protected void Page_Load(object sender, EventArgs e) { op = RequestData.Get <string>("op"); id = RequestData.Get <string>("id"); type = RequestData.Get <string>("type"); IList <string> entStrList = RequestData.GetList <string>("data"); WarehouseExchange ent = null; switch (RequestActionString) { case "create": ent = GetPostedData <WarehouseExchange>(); ent.ExchangeState = "未结束"; ent.OutWarehouseState = "未出库"; ent.InWarehouseState = "未入库"; ent.CreateId = UserInfo.UserID; ent.CreateName = UserInfo.Name; ent.CreateTime = System.DateTime.Now; ent.DoCreate(); ProcessDetail(entStrList, ent); DeliveryOrder doEnt = new DeliveryOrder(); doEnt.Number = DataHelper.QueryValue("select SHHG_AimExamine.dbo.fun_getDeliveryNumber()").ToString(); doEnt.DeliveryType = "调拨出库"; doEnt.PId = ent.Id; doEnt.WarehouseId = ent.FromWarehouseId; doEnt.WarehouseName = ent.FromWarehouseName; doEnt.DoCreate(); ProcessDeliveryOrderDetail(entStrList, doEnt); InWarehouse iwEnt = new InWarehouse(); iwEnt.WarehouseId = ent.ToWarehouseId; iwEnt.WarehouseName = ent.ToWarehouseName; iwEnt.InWarehouseNo = DataHelper.QueryValue <string>("select SHHG_AimExamine.dbo.fun_getInWarehouseNo()"); iwEnt.InWarehouseType = "调拨入库"; iwEnt.State = "未入库"; iwEnt.CreateId = UserInfo.UserID; iwEnt.CreateName = UserInfo.Name; iwEnt.CreateTime = System.DateTime.Now; iwEnt.PublicInterface = ent.Id; iwEnt.DoCreate(); ProcessInWarehouseDetail(entStrList, iwEnt); break; //case "update": // ent = this.GetMergedData<PurchaseOrder>(); // PurchaseOrderDetail.DeleteAll("PurchaseOrderId='" + ent.Id + "'"); // ProcessDetail(entStrList, ent); // ent.PurchaseType = "生产商采购"; // ent.DoUpdate(); // break; case "batchdelete": DoBatchDelete(); break; default: DoSelect(); break; } if (op != "c" && op != "cs") { if (!String.IsNullOrEmpty(id)) { string sql = @"select A.*,B.SupplierName,B.MoneyType,B.Symbo from SHHG_AimExamine..PurchaseOrder as A left join SHHG_AimExamine..Supplier as B on A.SupplierId=B.Id where A.Id='" + id + "'"; IList <EasyDictionary> ents = DataHelper.QueryDictList(sql); this.SetFormData(ents[0]); } } else//添加的时候找到默认供应商 { IList <EasyDictionary> dics = DataHelper.QueryDictList("select Id as SupplierId,SupplierName,MoneyType from SHHG_AimExamine..Supplier where IsDefault='on'"); if (dics.Count > 0) { this.SetFormData(dics[0]); } //添加的时候自动生成采购单流水号 PageState.Add("ExchangeNo", DataHelper.QueryValue("select SHHG_AimExamine.dbo.fun_GetWarehouseExchangeNo()")); } }