예제 #1
0
        private void InitComponent()
        {
            string productId = NumberRule.NewDataModel(17).GetValue(17);

            this.txtContractID.Text = productId;

            DataTable contractCategoryData = XSql.GetDataTable("SELECT * FROM CTR_Category");

            this.ddlCategory.DataSource     = contractCategoryData;
            this.ddlCategory.DataValueField = "ID";
            this.ddlCategory.DataTextField  = "Name";
            this.ddlCategory.DataBind();
            this.ddlCategory.Items.Insert(0, new ListItem("--请选择--", ""));

            DataTable projectData = XSql.GetDataTable("SELECT * FROM Pro_Projects");

            this.ddlProject.DataSource     = projectData;
            this.ddlProject.DataValueField = "ID";
            this.ddlProject.DataTextField  = "ProjectName";
            this.ddlProject.DataBind();

            Dict.BindListCtrl_DeptList(this.ddlDepartment, null, null, null);
            this.ddlDepartment.Items.Insert(0, new ListItem("--请选择--", ""));

            this.txtSignedDate.Text = DateTime.Now.ToString("yyyy-M-dd");
            this.txtStartDate.Text  = DateTime.Now.ToString("yyyy-M-dd");
            this.txtEndDate.Text    = DateTime.Now.ToString("yyyy-M-dd");
            this.txtInputDate.Text  = DateTime.Now.ToString("yyyy-M-dd");
            this.txtManager.Text    = WX.WXUser.GetRealNameByUserID(WX.Authentication.GetUserID());
        }
예제 #2
0
        private void InitComponent()
        {
            string productId = NumberRule.NewDataModel(15).GetValue(15);

            this.txtProductID.Text = productId;

            DataTable unitData = XSql.GetDataTable("SELECT ID,UnitName FROM Ass_Unit");

            this.ddlUnit.DataSource     = unitData;
            this.ddlUnit.DataTextField  = "UnitName";
            this.ddlUnit.DataValueField = "ID";
            this.ddlUnit.DataBind();

            DataTable suppliersData = XSql.GetDataTable("SELECT SupplierID,CompanyName FROM Ass_Suppliers");

            this.ddlSuppliers.DataSource     = suppliersData;
            this.ddlSuppliers.DataTextField  = "CompanyName";
            this.ddlSuppliers.DataValueField = "SupplierID";
            this.ddlSuppliers.DataBind();

            DataTable categoryData = XSql.GetDataTable("exec [dbo].[sp_get_tree_table] 'Ass_Category','ID','Name','ParentID','ID',0,1,5");

            this.ddlCategory.DataSource     = categoryData;
            this.ddlCategory.DataTextField  = "name";
            this.ddlCategory.DataValueField = "id";
            this.ddlCategory.DataBind();
        }
예제 #3
0
        private void InitComponent()
        {
            string productId = NumberRule.NewDataModel(16).GetValue(16);

            this.txtProductID.Text = productId;

            DataTable categoryData = XSql.GetDataTable("exec [dbo].[sp_get_tree_table] 'PDT_ProductCategory','ID','Name','ParentID','ID',0,1,5");

            this.ddlProductCategory.DataSource     = categoryData;
            this.ddlProductCategory.DataTextField  = "name";
            this.ddlProductCategory.DataValueField = "id";
            this.ddlProductCategory.DataBind();

            DataTable unitData = XSql.GetDataTable("SELECT * FROM Ass_Unit");

            this.ddlUnits.DataSource     = unitData;
            this.ddlUnits.DataValueField = "ID";
            this.ddlUnits.DataTextField  = "UnitName";
            this.ddlUnits.DataBind();
            if (WX.Main.GetConfigItem("Product_ISDept") == "1" && WX.Main.GetConfigItem("Product_OneDept") == "1")
            {
                BindDropList();
            }
            if (Request["ProductID"] != null && Request["ProductID"] != "")
            {
                MenuBar1.Key      = "Sale_Product_Edit";
                MenuBar1.Param1   = "{Q:ProductID}";
                MenuBar1.CurIndex = 2;
                WX.PDT.Product.MODEL product = WX.Request.rProduct;
                this.rIsEnable.SelectedValue          = product.IsEnable.ToString();
                this.txtProductID.Text                = product.ProductID.ToString();
                this.txtProductName.Text              = product.ProductName.ToString();
                this.ddlProductCategory.SelectedValue = product.CategoryID.ToString();
                this.txtSpecification.Text            = product.Specification.ToString();
                this.ddlUnits.SelectedValue           = product.Units.ToString();
                this.txtSalesPrice.Text               = product.SalesPrice.ToString();
                this.txtDiscountedPrice.Text          = product.DiscountedPrice.ToString();
                this.txtCostPrice.Text                = product.CostPrice.ToString();
                this.txtRemark.Text   = product.Remark.ToString();
                this.txtServices.Text = product.Services.ToString();
                if (WX.Main.GetConfigItem("Product_ISDept") == "1" && WX.Main.GetConfigItem("Product_OneDept") == "1")
                {
                    WX.PDT.ProductDept.MODEL productdept = WX.PDT.ProductDept.GetModel("select top 1 * from PDT_ProductDept where ProductID=" + WX.Request.rProductId + " order by ID desc");
                    if (productdept != null)
                    {
                        ProductDeptID.SelectedValue = productdept.DeptID.ToString();
                        MonthFee.Text          = productdept.MonthFee.ToString();
                        Fee.Text               = productdept.Fee.ToString();
                        Feetype1.SelectedValue = productdept.MonthFeeType.ToString();
                        Feetype2.SelectedValue = productdept.FeeType.ToString();
                        txtDeptRemarks.Text    = productdept.Remarks.ToString();
                    }
                }
            }
            if (WX.Main.GetConfigItem("Product_ISDept") == "1" && WX.Main.GetConfigItem("Product_OneDept") == "1")
            {
                pdept.Visible = true;
            }
        }