protected void btnSave_Click1(object sender, EventArgs e) { string type = "归还"; string opUserID = this.txtOpUserID.Value; string opTime = this.txtOpTime.Text.Trim(); string opIP = Request.UserHostAddress; string userId = this.hidden_ddlUser.Value; string departmentId = this.ddlDepartment.SelectedItem.Value; string quantity = this.txtQuantity.Text.Trim(); string productID = this.txtProductID.Text.Trim(); string content = this.txtRemarks.Text.Trim(); string unit = this.txtUnit.Text.Trim(); string price = this.txtPrice.Text.Trim(); WX.Ass.Log.MODEL logModel = WX.Ass.Log.NewDataModel(); logModel.Type.value = type; logModel.OpUserID.value = opUserID; logModel.OpTime.value = opTime; logModel.OpIP.value = opIP; logModel.UserID.value = userId; logModel.DepartmentID.value = departmentId; logModel.Quantity.value = quantity; logModel.ProductID.value = productID; logModel.Content.value = content; logModel.Unit.value = unit; logModel.Price.value = price; int singleRow = logModel.Save(); int row = 0; if (singleRow > 0) { if (this.PID.Value != "0") { XSql.Execute("EXEC Assets_UpdateQuantity " + this.PID.Value + "," + this.txtQuantity.Text + ", '" + this.txtProductID.Text + "','---" + content + "'"); if (row > 0) { WX.Main.AddLog(WX.LogType.Default, "产品归还成功!", null); } } } if (singleRow > 0) { ULCode.Debug.Confirm("产品归还成功!", "Ass_ReturnAssets.aspx", "Ass_ConsumingList.aspx"); } else { ULCode.Debug.Alert("产品归还失败!", "Ass_ReturnAssets.aspx"); } }
protected void btnSave_Click(object sender, EventArgs e) { string type = "出售"; string opUserID = this.txtOpUserID.Value; string opTime = this.txtOpTime.Text.Trim(); string opIP = Request.UserHostAddress; string quantity = this.txtQuantity.Text.Trim(); string productID = this.txtProductID.Text.Trim(); string content = this.txtRemarks.Text.Trim(); string unit = this.txtUnit.Text.Trim(); string price = this.txtPrice.Text.Trim(); WX.Ass.Log.MODEL logModel = WX.Ass.Log.NewDataModel(); logModel.Type.value = type; logModel.OpUserID.value = opUserID; logModel.OpTime.value = opTime; logModel.OpIP.value = opIP; logModel.Quantity.value = quantity; logModel.ProductID.value = productID; logModel.Content.value = content; logModel.Unit.value = unit; logModel.Price.value = price; int singleRow = logModel.Save(); int row = 0; if (singleRow > 0) { if (this.PID.Value != "0") { XSql.Execute("EXEC Assets_ProductSales " + this.PID.Value + "," + this.txtQuantity.Text.Trim()); if (row > 0) { WX.Main.AddLog(WX.LogType.Default, "产品出售成功!", null); } } } if (singleRow > 0) { ULCode.Debug.Confirm("产品出售成功!", "Ass_ProductSales.aspx", "Ass_LogList.aspx"); } else { ULCode.Debug.Alert("产品出售失败!", "Ass_ProductSales.aspx"); } }
protected void btnSave_Click(object sender, EventArgs e) { string type = "领用"; string opUserID = this.txtOpUserID.Value; string opTime = this.txtOpTime.Text.Trim(); string opIP = Request.UserHostAddress; string userId = this.hidden_ddlUser.Value; string departmentId = this.ddlDepartment.SelectedItem.Value; //string deadline = this.txtDeadline.Text.Trim(); string maturityDate = this.hidden_MaturityDate.Value; string quantity = this.txtQuantity.Text.Trim(); string productID = this.txtProductID.Text.Trim(); string content = this.txtRemarks.Text.Trim(); string unit = this.txtUnit.Text.Trim(); string price = this.txtPrice.Text.Trim(); WX.Ass.Log.MODEL logModel = WX.Ass.Log.NewDataModel(); logModel.Type.value = type; logModel.OpUserID.value = opUserID; logModel.OpTime.value = opTime; logModel.OpIP.value = opIP; logModel.UserID.value = userId; logModel.DepartmentID.value = departmentId; //logModel.Deadline.value = deadline; if (string.IsNullOrEmpty(maturityDate)) { logModel.MaturityDate.set(DBNull.Value); } else { logModel.MaturityDate.value = maturityDate; } logModel.Quantity.value = quantity; logModel.ProductID.value = productID; logModel.Content.value = content; logModel.Unit.value = unit; logModel.Price.value = price; int singleRow = logModel.Save(); int row = 0; if (singleRow > 0) { if (this.PID.Value != "0") { XSql.Execute("EXEC Assets_AddConsuming " + this.PID.Value + "," + this.txtQuantity.Text + ",'" + this.txtProductID.Text + "'"); Equipment.MODEL equipmentModel = Equipment.NewDataModel(); equipmentModel.DepartmentID.value = departmentId; equipmentModel.UserID.value = userId; equipmentModel.ProductID.value = productID; equipmentModel.Quantity.value = quantity; equipmentModel.AddDate.value = opTime; equipmentModel.Price.value = price; equipmentModel.Unit.value = unit; equipmentModel.Remark.value = content; equipmentModel.Save(); if (row > 0) { WX.Main.AddLog(WX.LogType.Default, "产品领用添加成功!", null); } } } if (singleRow > 0) { ULCode.Debug.Confirm("产品领用添加成功!", "Ass_AddConsuming.aspx", "Ass_AssetsList.aspx"); } else { ULCode.Debug.Alert("产品领用添加失败!", "Ass_AddConsuming.aspx"); } }
protected void btnSave_Click(object sender, EventArgs e) { //1.验证用户权限 if (!this.Master.A_Edit) { Response.Write("你没有权限访问此功能!"); Response.End(); return; } //2.取得用户变量 if (this.SelectedProduct.Value == "false") { WX.Ass.Warehouse.MODEL warehouse = WX.Ass.Warehouse.NewDataModel(); warehouse.ProductID.value = this.txtProductID.Text.Trim(); warehouse.ProductName.value = this.txtProductName.Text.Trim(); warehouse.Quantity.value = this.txtQuantity.Text.Trim(); warehouse.CategoryID.value = this.ddlCategory.SelectedItem.Value; warehouse.UsedQuantity.value = 0; warehouse.Unit.value = this.ddlUnit.SelectedItem.Text; warehouse.Price.value = this.txtPrice.Text.Trim(); warehouse.Suppliers.value = this.ddlSuppliers.SelectedItem.Value; warehouse.Specification.value = this.txtSpecification.Text.Trim(); warehouse.Color.value = this.txtColor.Text.Trim(); warehouse.Brand.value = this.txtBrand.Text.Trim(); warehouse.Model.value = this.txtModel.Text.Trim(); warehouse.ProductPhoto.value = this.txtProductPhoto.Text.Trim(); warehouse.LastTime.value = DateTime.Now.ToString("yyyy-MM-dd"); warehouse.Remark.value = this.txtRemarks.Text.Trim(); //3.验证用户变量,包含Request.QueryString及Request.Form //4.业务处理过程 int row = 0; int singleRow = 0; row = warehouse.Save(); //填写主要业务逻辑代码 //5.(用户及业务对象)统计与状态 //6.登记日志 if (row > 0) { string type = "入库"; string opUserID = WX.Authentication.GetUserID(); string opTime = DateTime.Now.ToString("yyyy-MM-dd"); string opIP = Request.UserHostAddress; string userId = this.ddlSuppliers.SelectedItem.Value; string departmentId = ""; string quantity = this.txtQuantity.Text.Trim(); string productID = this.txtProductID.Text.Trim(); string content = this.txtRemarks.Text.Trim(); string unit = this.ddlUnit.SelectedItem.Text; string price = this.txtPrice.Text.Trim(); WX.Ass.Log.MODEL logModel = WX.Ass.Log.NewDataModel(); logModel.Type.value = type; logModel.OpUserID.value = opUserID; logModel.OpTime.value = opTime; logModel.OpIP.value = opIP; logModel.UserID.value = userId; logModel.DepartmentID.value = departmentId; logModel.Quantity.value = quantity; logModel.ProductID.value = productID; logModel.Content.value = content; logModel.Unit.value = unit; logModel.Price.value = price; singleRow = logModel.Save(); if (singleRow > 0) { WX.Main.AddLog(WX.LogType.Default, "产品日志添加成功!", null); WX.Main.AddLog(WX.LogType.Default, "产品信息添加成功!", null); } } //7.返回处理结果或返回其它页面。 if (singleRow > 0) { ULCode.Debug.Confirm("产品信息添加成功!", "Ass_AddAssets.aspx", "Ass_AssetsList.aspx"); } else { ULCode.Debug.Alert("产品信息添加失败!", "Ass_AddAssets.aspx"); } } else { WX.Ass.Warehouse.MODEL warehouse = WX.Ass.Warehouse.NewDataModel(this.SelectedID.Value); warehouse.Quantity.value = Convert.ToInt32(warehouse.Quantity.value) + Convert.ToInt32(this.txtQuantity.Text); int row = warehouse.Update(); int singleRow = 0; //6.登记日志 if (row > 0) { string type = "入库"; string opUserID = WX.Authentication.GetUserID(); string opTime = DateTime.Now.ToString("yyyy-MM-dd"); string opIP = Request.UserHostAddress; string userId = this.ddlSuppliers.SelectedItem.Value; string departmentId = ""; string quantity = this.txtQuantity.Text.Trim(); string productID = this.txtProductID.Text.Trim(); string content = this.txtRemarks.Text.Trim(); string unit = this.ddlUnit.SelectedItem.Text; string price = this.txtPrice.Text.Trim(); WX.Ass.Log.MODEL logModel = WX.Ass.Log.NewDataModel(); logModel.Type.value = type; logModel.OpUserID.value = opUserID; logModel.OpTime.value = opTime; logModel.OpIP.value = opIP; logModel.UserID.value = userId; logModel.DepartmentID.value = departmentId; logModel.Quantity.value = quantity; logModel.ProductID.value = productID; logModel.Content.value = content; logModel.Unit.value = unit; logModel.Price.value = price; singleRow = logModel.Save(); if (singleRow > 0) { WX.Main.AddLog(WX.LogType.Default, "产品日志添加成功!", null); WX.Main.AddLog(WX.LogType.Default, "产品信息添加成功!", null); } } //7.返回处理结果或返回其它页面。 if (singleRow > 0) { ULCode.Debug.Confirm("产品信息添加成功!", "Ass_AddAssets.aspx", "Ass_AssetsList.aspx"); } else { ULCode.Debug.Alert("产品信息添加失败!", "Ass_AddAssets.aspx"); } } }