protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         string productId             = Request.QueryString["ProductID"];
         WX.Ass.Warehouse.MODEL model = WX.Ass.Warehouse.GetModel("SELECT * FROM Ass_Warehouse WHERE ProductID='" + productId + "'");
         this.lblProductName.Text   = model.ProductName.value.ToString();
         this.lblProductID.Text     = model.ProductID.value.ToString();
         this.lblQuantity.Text      = model.Quantity.value.ToString();
         this.lblProductType.Text   = GetCategoryByID(model.CategoryID.value.ToString());
         this.lblUnit.Text          = model.Unit.value.ToString();
         this.lblPrice.Text         = model.Price.value.ToString();
         this.lblSpecification.Text = model.Specification.value.ToString();
         this.lblSupplier.Text      = GetSupplierByID(model.Suppliers.value.ToString());
         this.lblColor.Text         = model.Color.value.ToString();
         this.lblBrand.Text         = model.Brand.value.ToString();
         this.lblModel.Text         = model.Model.value.ToString();
         this.lblRemark.Text        = model.Remark.value.ToString();
         if (string.IsNullOrEmpty(model.ProductPhoto.value.ToString()))
         {
             this.Image1.ImageUrl = "~/Manage/images/no picture.jpg";
         }
         else
         {
             this.Image1.ImageUrl = "../../" + model.ProductPhoto.value.ToString();
         }
     }
 }
Exemple #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Master.A_Edit)
     {
         Response.Write("你没有权限访问此功能!");
         Response.End();
     }
     if (!IsPostBack)
     {
         InitComponent();
         string id = WX.Request.rWarehouseID.ToString();
         WX.Ass.Warehouse.MODEL warehouseModel = WX.Request.rWarehouse;
         this.txtProductID.Text         = warehouseModel.ProductID.value.ToString();
         this.txtProductName.Text       = warehouseModel.ProductName.value.ToString();
         this.txtQuantity.Text          = warehouseModel.Quantity.value.ToString();
         this.ddlCategory.SelectedValue = warehouseModel.CategoryID.value.ToString();
         if (ddlUnit.Items.FindByText(warehouseModel.Unit.value.ToString()) != null)
         {
             this.ddlUnit.Items.FindByText(warehouseModel.Unit.value.ToString()).Selected = true;
         }
         this.txtPrice.Text = warehouseModel.Price.value.ToString();
         this.ddlSuppliers.SelectedValue = warehouseModel.Suppliers.value.ToString();
         this.txtSpecification.Text      = warehouseModel.Specification.value.ToString();
         this.txtColor.Text             = warehouseModel.Color.value.ToString();
         this.txtBrand.Text             = warehouseModel.Brand.value.ToString();
         this.txtModel.Text             = warehouseModel.Model.value.ToString();
         this.hidden_ProductPhoto.Value = warehouseModel.ProductPhoto.value.ToString();
         this.txtProductPhoto.Text      = warehouseModel.ProductPhoto.value.ToString();
         this.txtRemarks.Text           = warehouseModel.Remark.value.ToString();
     }
 }
Exemple #3
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            //1.验证用户权限
            if (!this.Master.A_Edit)
            {
                Response.Write("你没有权限访问此功能!");
                Response.End();
                return;
            }
            //2.获取用户变量
            string id = WX.Request.rWarehouseID.ToString();

            WX.Ass.Warehouse.MODEL warehouse = WX.Request.rWarehouse;
            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;

            row = warehouse.Update();
            //填写主要业务逻辑代码
            //5.(用户及业务对象)统计与状态

            //6.登记日志
            if (row > 0)
            {
                WX.Main.AddLog(WX.LogType.Default, "产品信息修改成功!", null);
            }
            //7.返回处理结果或返回其它页面。
            if (row > 0)
            {
                ULCode.Debug.Alert("产品信息修改成功!", "Ass_AssetsList.aspx");
            }
            else
            {
                ULCode.Debug.Alert("产品信息修改失败!", "Ass_AssetsList.aspx");
            }
        }
Exemple #4
0
        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");
                }
            }
        }