public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "json";
            string code = context.Request.QueryString["Code"];

            if (!string.IsNullOrEmpty(code) && !string.IsNullOrEmpty("Region"))
            {
                string sSql = string.Empty;
                if (context.Request.QueryString["Region"] == "Province")
                {
                    sSql = "SELECT code,name FROM CRM_City WHERE ProvinceId='" + context.Request.QueryString["code"] + "'";
                }
                if (context.Request.QueryString["Region"] == "City")
                {
                    sSql = "SELECT code,name FROM CRM_Area WHERE CityId='" + context.Request.QueryString["code"] + "'";
                }
                var dataTable = XSql.GetDataTable(sSql);
                var cities    = dataTable.AsEnumerable().Select(c => new
                {
                    Code = c.Field <string>("code"),
                    Name = c.Field <string>("name")
                });
                string json = JsonConvert.SerializeObject(cities);
                context.Response.Write(json);
            }
            else
            {
                context.Response.Write("");
            }
        }
Exemplo n.º 2
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());
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //1.验证当前用户页面权限
            if (!this.Master.A_Edit)
            {
                Response.Write("你没有权限访问此功能!");
                Response.End();

                return;
            }
            if (!IsPostBack)
            {
                int       Id    = WX.Request.rFlowID;
                DataTable table = XSql.GetDataTable("SELECT * FROM Fl_FlowManage");
                var       query = table.AsEnumerable().Where(f => f.Field <Int16>("FlowId") == Id).Select(f => new
                {
                    ManageId      = f.Field <Int16>("Id"),
                    FlowId        = f.Field <Int16>("FlowId"),
                    ManageType    = GetManageTypeById(Convert.ToInt32(f.Field <Byte>("ManageType"))),
                    DelegateScope = GetDelegateScope(f.Field <string>("UserList"), f.Field <string>("DeptList"), f.Field <string>("DutyList")),
                    Scope         = GetManageScope(f.Field <string>("Scope"))
                });
                this.Repeater1.DataSource = query;
                this.Repeater1.DataBind();
            }
        }
Exemplo n.º 4
0
        private void InitComponent()
        {
            DataTable productData = XSql.GetDataTable("SELECT P.*,C.Name FROM PDT_Products AS P LEFT JOIN PDT_ProductCategory AS C ON P.CategoryID=C.ID");

            this.ProductRepeater.DataSource = productData;
            this.ProductRepeater.DataBind();
        }
Exemplo n.º 5
0
        public void ProcessRequest(HttpContext context)
        {
            this.PermissionNum = WX.Main.GetPermission(true);
            if (this.PermissionNum == -1)
            {
                context.Response.Write("-1");
                context.Response.End();
                return;
            }
            this.A_Read = this.PermissionNum >= Convert.ToInt32(PermissionType.Read);

            //1.验证当前用户页面权限
            if (!A_Read)
            {
                context.Response.Write("您没有读取的权限");
                context.Response.End();
                return;
            }
            context.Response.ContentType = "text/plain";
            //1.获取用户变量
            int companyId = WX.Request.rCompanyId;
            //2.验证用变量
            DataTable data = XSql.GetDataTable("select * from view_Departments WHERE CompanyID=" + companyId + " order by NO asc");
            string    json = GetJsonTree(data, 0);

            if (json.Length > 12)
            {
                json = json.Substring(12);
            }
            context.Response.Write(json);
        }
Exemplo n.º 6
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();
        }
Exemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //1.验证当前用户页面权限
            if (!this.Master.A_Edit)
            {
                Response.Write("你没有权限访问此功能!");
                Response.End();

                return;
            }
            if (!IsPostBack)
            {
                string    cmdText   = "SELECT * FROM Fl_FlowTimer WHERE FlowId=" + WX.Request.rFlowID;
                DataTable dataTable = XSql.GetDataTable(cmdText);
                var       query     = dataTable.AsEnumerable().Select(f => new
                {
                    Id         = f.Field <int>("Id"),
                    RemindType = Dict.GetItemTextByValue(Dict.GetListItems_enum_RemindType(), f.Field <Byte>("RemindType").ToString()),
                    UserList   = CommonUtils.GetRealNameListByUserIdList(f.Field <string>("UserList").ToString()),
                    RemindTime = f.Field <DateTime>("RemindTime"),
                    LastTime   = f.Field <string>("LastTime") == null ? "" : f.Field <DateTime>("LastTime").ToString()
                });
                this.TimerRepeater.DataSource = query;
                this.TimerRepeater.DataBind();
            }
        }
Exemplo n.º 8
0
        //以下为实体开发部分
        //
        public static string GetFileCode(int fID)
        {
            DataTable dt   = XSql.GetDataTable("select count(*) from FL_Run where FlowId=" + fID + " and DateDiff(mm,BeginTime,getdate())=0");
            int       code = Convert.ToInt32(dt.Rows[0][0]) + 1;

            return(String.Format("{0}{1}", DateTime.Now.ToString("yyyyMM"), code > 9 ? code.ToString() : "0" + code));
        }
        private void InitComponent()
        {
            string id = Request.QueryString["ID"];
            //WX.CTR.Contract.MODEL model = WX.CTR.Contract.NewDataModel(id);
            DataTable contractData = XSql.GetDataTable("SELECT CO.*,CA.Name,PR.ProjectName,DE.Name AS DepartmentName FROM CTR_Contracts AS CO LEFT JOIN CTR_Category AS CA ON CO.CategoryID=CA.ID LEFT JOIN PRO_Projects AS PR ON CO.ProjectID=PR.ID LEFT JOIN TE_Departments AS DE ON CO.DepartmentID=DE.ID WHERE CO.ID=" + id);

            this.ltlContractName.Text     = contractData.Rows[0]["ContractName"].ToString();
            this.ltlContractID.Text       = contractData.Rows[0]["ContractID"].ToString();
            this.ltlCateogry.Text         = contractData.Rows[0]["Name"].ToString();
            this.ltlProject.Text          = contractData.Rows[0]["ProjectName"].ToString();
            this.ltlAmount.Text           = contractData.Rows[0]["ContractAmount"].ToString();
            this.ltlCurrency.Text         = contractData.Rows[0]["Currency"].ToString();
            this.ltlSignedDate.Text       = String.Format("{0:yyyy-MM-dd}", Convert.ToDateTime(contractData.Rows[0]["SignedDate"].ToString()));
            this.ltlDepartment.Text       = contractData.Rows[0]["DepartmentName"].ToString();
            this.ltlEmployee.Text         = WX.WXUser.GetRealNameByUserID(contractData.Rows[0]["EmployeeID"].ToString());
            this.ltlPaymentType.Text      = contractData.Rows[0]["PaymentType"].ToString();
            this.ltlStartDate.Text        = String.Format("{0:yyyy-MM-dd}", Convert.ToDateTime(contractData.Rows[0]["StartDate"].ToString()));
            this.ltlEndDate.Text          = String.Format("{0:yyyy-MM-dd}", Convert.ToDateTime(contractData.Rows[0]["EndDate"].ToString()));
            this.txtContractContent.Text  = contractData.Rows[0]["ContractContent"].ToString();
            this.txtContractAbnormal.Text = contractData.Rows[0]["ContractAbnormal"].ToString();
            this.ltlPartyA.Text           = contractData.Rows[0]["PartyA"].ToString();
            this.ltlPartyAPerson.Text     = contractData.Rows[0]["PartyAPerson"].ToString();
            this.ltlPartyB.Text           = contractData.Rows[0]["PartyB"].ToString();
            this.ltlPartyBPerson.Text     = contractData.Rows[0]["PartyBPerson"].ToString();
            this.ltlDigitPath.Text        = contractData.Rows[0]["DigitPath"].ToString();
            this.ltlImplementation.Text   = contractData.Rows[0]["Implementation"].ToString();
            this.ltlInputDate.Text        = String.Format("{0:yyyy-MM-dd}", Convert.ToDateTime(contractData.Rows[0]["InputDate"].ToString()));
            this.ltlManager.Text          = contractData.Rows[0]["Managers"].ToString();
        }
Exemplo n.º 10
0
        private void InitComponent()
        {
            DataTable categoryData = XSql.GetDataTable("SELECT * FROM PDT_SupplierCategory");

            this.ddlCateogryID.DataSource     = categoryData;
            this.ddlCateogryID.DataValueField = "ID";
            this.ddlCateogryID.DataTextField  = "Name";
            this.ddlCateogryID.DataBind();
            this.ddlCateogryID.Items.Insert(0, new ListItem("--请选择--", ""));
            string supplierID = WX.Request.rSupplierID.ToString();

            WX.Ass.Supplier.MODEL model = WX.Request.rSupplier;
            this.txtCompanyName.Text         = model.CompanyName.value.ToString();
            this.txtTelephone.Text           = model.Telephone.ToString();
            this.txtFax.Text                 = model.Fax.ToString();
            this.txtZipCode.Text             = model.ZipCode.ToString();
            this.txtQQNumber.Text            = model.QQNumber.ToString();
            this.txtEmail.Text               = model.Email.ToString();
            this.txtWebSite.Text             = model.WebSite.ToString();
            this.txtMobilePhone.Text         = model.MobilePhone.ToString();
            this.txtAddress.Text             = model.Address.ToString();
            this.txtContactName.Text         = model.ContactName.ToString();
            this.ddlCateogryID.SelectedValue = model.SupplierCategoryID.ToString();
            this.txtRemark.Text              = model.Remark.ToString();
        }
Exemplo n.º 11
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;
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            DataTable dataTable = XSql.GetDataTable("Select tcp.*,te.RealName,te2.RealName ManageName,te.Sex,te.Edu from [TE_Companys_Partner] tcp left join TU_Users te on tcp.EmployeeID=te.UserID left join TU_Users te2 on tcp.Manage=te2.UserID where tcp.Id=" + context.Request.QueryString["ID"]);
            string    json      = JsonConvert.SerializeObject(dataTable);

            context.Response.Write(json);
        }
Exemplo n.º 13
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            DataTable dataTable = XSql.GetDataTable("Select UserID,RealName,Sex,Edu,IDCard from TU_Employees where UserID='" + context.Request.QueryString["ID"] + "'");
            string    json      = JsonConvert.SerializeObject(dataTable);

            context.Response.Write(json);
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            DataTable dataTable = XSql.GetDataTable("SELECT w.*,s.CompanyName,u.ID AS UnitID,u.UnitName FROM Ass_Warehouse AS w LEFT JOIN Ass_Suppliers AS s ON w.Suppliers=s.SupplierID LEFT JOIN Ass_Unit AS u ON w.Unit=u.UnitName WHERE w.ID=" + context.Request.QueryString["ProductID"]);
            string    json      = JsonConvert.SerializeObject(dataTable);

            context.Response.Write(json);
        }
Exemplo n.º 15
0
        private void InitComponent()
        {
            string id = WX.Request.rContractID.ToString();

            WX.CTR.Contract.MODEL contractModel = WX.Request.rContract;
            this.txtContractID.Text   = contractModel.ContractID.value.ToString();
            this.txtContractName.Text = contractModel.ContractName.value.ToString();

            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("--请选择--", ""));
            this.ddlCategory.SelectedValue = contractModel.CategoryID.ToString();

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

            this.ddlProject.DataSource     = projectData;
            this.ddlProject.DataValueField = "ID";
            this.ddlProject.DataTextField  = "ProjectName";
            this.ddlProject.DataBind();
            this.ddlProject.SelectedValue = contractModel.ProjectID.value.ToString();

            this.txtPrice.Text             = String.Format("{0:0,0.00}", contractModel.ContractAmount.ToString());
            this.ddlCurrency.SelectedValue = contractModel.Currency.ToString();
            this.txtSignedDate.Text        = Convert.ToDateTime(contractModel.SignedDate.value).ToString("yyyy-MM-dd");
            Dict.BindListCtrl_DeptList(this.ddlDepartment, null, null, null);
            this.ddlDepartment.Items.Insert(0, new ListItem("--请选择--", "0"));
            this.ddlDepartment.SelectedValue = contractModel.DepartmentID.ToString();
            if (!string.IsNullOrEmpty(contractModel.EmployeeID.value.ToString()))
            {
                this.ddlEmployee.Items.Clear();
                DataTable employeeData = XSql.GetDataTable("SELECT UserID,RealName FROM TU_Employees WHERE DepartmentID=" + contractModel.DepartmentID.value.ToString());
                this.ddlEmployee.DataSource     = employeeData;
                this.ddlEmployee.DataTextField  = "RealName";
                this.ddlEmployee.DataValueField = "UserID";
                this.ddlEmployee.DataBind();
                this.ddlEmployee.Value        = contractModel.EmployeeID.value.ToString();
                this.hidden_ddlEmployee.Value = contractModel.EmployeeID.value.ToString();
            }
            this.ddlEmployee.Attributes.Remove("disabled");
            this.ddlPaymentType.SelectedValue = contractModel.PaymentType.value.ToString();
            this.txtStartDate.Text            = Convert.ToDateTime(contractModel.StartDate.value).ToString("yyyy-MM-dd");
            this.txtEndDate.Text = Convert.ToDateTime(contractModel.EndDate.value).ToString("yyyy-MM-dd");
            this.ddlReceivablesPayment.SelectedValue = contractModel.ReceivablesPayment.value.ToString();
            this.txtContractContent.Text             = contractModel.ContractContent.ToString();
            this.txtContractAbnormal.Text            = contractModel.ContractAbnormal.ToString();
            this.txtPartyA.Text                  = contractModel.PartyA.ToString();
            this.txtPartyAPerson.Text            = contractModel.PartyAPerson.ToString();
            this.txtPartyB.Text                  = contractModel.PartyB.ToString();
            this.txtPartyBPerson.Text            = contractModel.PartyBPerson.ToString();
            this.ddlImplementation.SelectedValue = contractModel.Implementation.value.ToString();
            this.txtManager.Text                 = contractModel.Managers.ToString();

            this.txtInputDate.Text = DateTime.Now.ToString("yyyy-M-dd");
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string    id            = context.Request.QueryString["ID"];
            DataTable consumingData = XSql.GetDataTable("SELECT c.ID,c.ProductID,c.Quantity,w.ProductName,c.Unit,c.Price FROM Ass_Equipment AS c INNER JOIN Ass_Warehouse AS w ON c.ProductID=w.ProductID WHERE c.ID=" + id);
            string    json          = JsonConvert.SerializeObject(consumingData);

            context.Response.Write(json);
        }
Exemplo n.º 17
0
        private void InitComponent(bool start, string sql)
        {
            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();
            this.ddlProject.Items.Insert(0, new ListItem("--所有项目--", ""));


            DataTable contractData = WX.Main.GetPagedRows(sql, 0, "ORDER BY ContractID", 2, AspNetPager1.CurrentPageIndex);

            if (contractData == null)
            {
                Response.Write("aaa");
                Response.End();
            }
            var contracts = contractData.AsEnumerable().Select(c => new
            {
                ID                 = c.Field <int>("ID"),
                ContractID         = c.Field <string>("ContractID"),
                ContractName       = c.Field <string>("ContractName"),
                CategoryName       = c.Field <string>("Name"),
                ProjectName        = c.Field <string>("ProjectName"),
                Amount             = String.Format("{0:0,0.00}", c.Field <decimal>("ContractAmount")),
                Currency           = c.Field <string>("Currency"),
                SignedDate         = c.Field <DateTime>("SignedDate").ToString("yyyy-MM-dd"),
                EndDate            = c.Field <DateTime>("EndDate").ToString("yyyy-MM-dd"),
                ReceivablesPayment = c.Field <string>("ReceivablesPayment"),
                Implementation     = c.Field <string>("Implementation")
            });

            this.ContractListView.DataSource = contracts;
            this.ContractListView.DataBind();
            this.AspNetPager1.AlwaysShow = true;
            if (start)
            {
                this.AspNetPager1.AlwaysShow       = true;
                this.AspNetPager1.RecordCount      = WX.Main.GetPagedRowsCount(sql);
                this.AspNetPager1.PageSize         = 2;
                this.AspNetPager1.CurrentPageIndex = 1;
            }
            else
            {
                this.AspNetPager1.RecordCount      = WX.Main.GetPagedRowsCount(sql);
                this.AspNetPager1.CurrentPageIndex = this.AspNetPager1.CurrentPageIndex;
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string    id          = context.Request.QueryString["ID"];
            DataTable productData = XSql.GetDataTable("SELECT * FROM PDT_Products WHERE ID=" + id);
            string    json        = JsonConvert.SerializeObject(productData);

            context.Response.Write(json);
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "json";
            string    categoryId  = context.Request.QueryString["CategoryID"];
            DataTable productData = XSql.GetDataTable("SELECT ProductID,ProductName FROM Ass_Warehouse WHERE CategoryID=" + categoryId);
            string    json        = JsonConvert.SerializeObject(productData);

            context.Response.Write(json);
        }
Exemplo n.º 20
0
        private void InitComponent()
        {
            DataTable categoryData = XSql.GetDataTable("exec [dbo].[sp_get_tree_table] 'CRM_Category','ID','CategoryName','ParentID','ID',0,1,5");

            this.ddlCategoryID.DataSource     = categoryData;
            this.ddlCategoryID.DataValueField = "id";
            this.ddlCategoryID.DataTextField  = "name";
            this.ddlCategoryID.DataBind();
        }
Exemplo n.º 21
0
        private void InitComponent()
        {
            DataTable categoryData = XSql.GetDataTable("SELECT * FROM PDT_SupplierCategory");

            this.ddlCategoryID.DataSource     = categoryData;
            this.ddlCategoryID.DataValueField = "ID";
            this.ddlCategoryID.DataTextField  = "Name";
            this.ddlCategoryID.DataBind();
            this.ddlCategoryID.Items.Insert(0, new ListItem("--请选择供应商类别--", "0"));
        }
Exemplo n.º 22
0
        /// <summary>
        /// 根据条件获取部门负责人用户编号多个编号用,分割
        /// </summary>
        /// <param name="Wherestr">null或“”将查询全部</param>
        /// <returns></returns>
        public static string GetUserIDListByDeptID(int topN, string clom, int id)
        {
            string users = XSql.GetDataTable("SELECT " + clom + " FROM TE_Departments where ID=" + id).Rows[0][0].ToString();

            if (users != "")
            {
                users = XSql.GetXDataTable("SELECT" + (topN > 0 ? " top " + topN : "") + " UserID FROM TU_Users where UserID in('" + users.Replace(",", "','") + "') and State in(10,20) order by Grade desc").ToColValueList("','");
            }
            return(users);
        }
Exemplo n.º 23
0
        public string GetDept(string id)
        {
            string    bodystr = "";
            DataTable dt      = XSql.GetDataTable("select ppd.id,td.Name from PDT_ProductDept ppd left join TE_Departments td on ppd.DeptID=td.ID where ProductID=" + id);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                bodystr += "<a href='AddProductDept.aspx?ProductID=" + id + "&ProductDeptID=" + dt.Rows[i]["id"] + "'>" + dt.Rows[i]["Name"] + "</a>&nbsp;&nbsp;";
            }
            bodystr += "<a href='AddProductDept.aspx?ProductID=" + id + "'>添加</a>&nbsp;&nbsp;";
            return(bodystr);
        }//删除处理过程
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string json = string.Empty;

            if (!string.IsNullOrEmpty(context.Request.QueryString["SupplierID"]))
            {
                DataTable data = XSql.GetDataTable("SELECT CompanyName,ContactName FROM Ass_Suppliers WHERE SupplierID=" + context.Request.QueryString["SupplierID"]);
                json = JsonConvert.SerializeObject(data);
            }
            context.Response.Write(json);
        }
Exemplo n.º 25
0
        protected void ddlCategoryID_SelectedIndexChanged(object sender, EventArgs e)
        {
            string categoryId = this.ddlCategoryID.SelectedItem.Value;

            if (categoryId != "0")
            {
                DataTable supplierData = XSql.GetDataTable("SELECT CompanyName,ContactName FROM Ass_Suppliers WHERE SupplierCategoryID=" + categoryId);
                this.lstSuppliers.DataSource     = supplierData;
                this.lstSuppliers.DataTextField  = "CompanyName";
                this.lstSuppliers.DataValueField = "CompanyName";
                this.lstSuppliers.DataBind();
            }
            ClientScript.RegisterStartupScript(this.GetType(), "a", "window.parent.SetSelectedTab('选择供应商')", true);
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         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();
         this.ddlCategory.Items.Insert(0, new ListItem("--请选择--", "0"));
         string sql = "SELECT w.*,s.CompanyName,u.ID AS UnitID FROM Ass_Warehouse AS w LEFT JOIN Ass_Suppliers AS s ON w.Suppliers=s.SupplierID LEFT JOIN Ass_Unit AS u ON w.Unit=u.UnitName WHERE w.ID > 0";
         InitWarehouseData(true, sql);
     }
 }
Exemplo n.º 27
0
        protected void ddlCategoryID_SelectedIndexChanged(object sender, EventArgs e)
        {
            string categoryId = this.ddlCategoryID.SelectedItem.Value;

            if (categoryId != "1")
            {
                DataTable customerData = XSql.GetDataTable("SELECT CustomerName FROM CRM_Customers WHERE CategoryID=" + categoryId);
                this.lstCustomers.DataSource     = customerData;
                this.lstCustomers.DataTextField  = "CustomerName";
                this.lstCustomers.DataValueField = "CustomerName";
                this.lstCustomers.DataBind();
            }
            ClientScript.RegisterStartupScript(this.GetType(), "a", "window.parent.SetSelectedTab('选择客户')", true);
        }
Exemplo n.º 28
0
        private void BindDepartments()
        {
            DataTable dataTable   = XSql.GetDataTable("exec [dbo].[sp_get_tree_multi_table] 'TE_Departments','ID','Name','ParentID','ID',0,1,5");
            var       departments = dataTable.AsEnumerable().Select((item, index) => new
            {
                DepartmentId   = item.Field <int>("ID"),
                DepartmentName = item.Field <string>("Name"),
                index          = index,
                Node_Name      = item.Field <string>("node_name")
            });

            this.DepartmentRepeater.DataSource = departments;
            this.DepartmentRepeater.DataBind();
        }
Exemplo n.º 29
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "json";
            string    departmentID = context.Request.QueryString["DepartmentID"];
            DataTable employeeData = XSql.GetDataTable("SELECT UserID,RealName FROM TU_Users WHERE" + (departmentID != "" ? " DepartmentID=" + departmentID + " and" : "") + " State>=10 and State<40 order by DepartmentID");
            var       employees    = employeeData.AsEnumerable().Select(e => new
            {
                UserID   = e.Field <Guid>("UserID"),
                UserName = e.Field <string>("RealName")
            });
            string json = JsonConvert.SerializeObject(employees);

            context.Response.Write(json);
        }
Exemplo n.º 30
0
        protected void ddlDepartment_SelectedIndexChanged(object sender, EventArgs e)
        {
            string departmentId = this.ddlDepartment.SelectedItem.Value;

            if (departmentId != "0")
            {
                DataTable employeeData = XSql.GetDataTable("SELECT UserID,RealName FROM TU_Employees WHERE DepartmentID=" + departmentId);
                this.lstEmployees.DataSource     = employeeData;
                this.lstEmployees.DataTextField  = "RealName";
                this.lstEmployees.DataValueField = "UserID";
                this.lstEmployees.DataBind();
            }
            ClientScript.RegisterStartupScript(this.GetType(), "a", "window.parent.SetSelectedTab('选择人员')", true);
        }