Example #1
0
            public int Del()
            {
                string sSql = "exec [dbo].[Delete_Run] " + this.Id.ToString();
                int    rows = XSql.Execute(sSql);

                return(rows);
            }
        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("");
            }
        }
Example #3
0
            private string GetFlowName()
            {
                string flowId = HttpContext.Current.Request.QueryString["Flow_ID"];

                //string flowId = "1";
                return(XSql.GetData("SELECT Name FROM FL_Flows WHERE ID=" + flowId).ToStr());
            }
Example #4
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();
        }
Example #5
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();
        }
Example #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();
        }
        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();
            }
        }
Example #8
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);
        }
Example #9
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 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());
        }
        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();
        }
Example #12
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();
            }
        }
        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;
            }
        }
Example #14
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            //1.验证用户权限
            if (!this.Master.A_Edit)
            {
                Response.Write("你没有权限访问此功能!");
                Response.End();
                return;
            }
            //2.取得用户变量
            string flowId = string.Empty;

            if (chkAllFlow.Checked == true)
            {
                flowId = "0";
            }
            else
            {
                flowId = this.ddlFlowName.SelectedItem.Value;
            }
            string principal      = this.hidden_Principal.Value;
            string beThePrincipal = this.hidden_BeThePrincipal.Value;
            string startTime      = "null";
            string endTime        = "null";
            int    status         = 1;                                  //1表示委托状态 0表示不是委托状态

            if (!string.IsNullOrEmpty(this.txtStartTime.Text))
            {
                startTime = String.Format("'{0}'", this.txtStartTime.Text);
            }
            if (!string.IsNullOrEmpty(this.txtEndTime.Text))
            {
                endTime = String.Format("'{0}'", this.txtEndTime.Text);
            }

            //3.验证用户变量,包含Request.QueryString及Request.Form

            //4.业务处理过程
            string cmdText = "INSERT INTO FL_FlowAuthorization (FlowId,FromUserId,ToUserId,BeginDate,EndDate,Status) VALUES (" + flowId + ",'" + principal + "','" + beThePrincipal + "'," + startTime + "," + endTime + "," + status + ")";
            int    row     = XSql.Execute(cmdText);

            //5.(用户及业务对象)统计与状态

            //6.登记日志
            if (row > 0)
            {
                XSql.Execute("exec dbo.Main_RefreshFlowAuthorizationState");
                WX.Main.AddLog(WX.LogType.Default, "委托添加成功!", null);
            }
            //7.返回处理结果或返回其它页面。
            if (row > 0)
            {
                ULCode.Debug.Alert("委托添加成功!", "Work_DelegateList.aspx");
            }
            else
            {
                ULCode.Debug.Alert("委托添加失败!", "Work_DelegateList.aspx");
            }
        }
        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);
        }
        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);
        }
Example #17
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);
        }
Example #18
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 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);
        }
Example #21
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();
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            this.PermissionNum           = WX.Main.GetPermission(true);
            if (this.PermissionNum == -1)
            {
                context.Response.Write("-1");
                context.Response.End();
                return;
            }
            this.A_Del = this.PermissionNum >= Convert.ToInt32(PermissionType.Del);

            //1.验证当前用户页面权限
            if (!A_Del)
            {
                context.Response.Write("-2");
                context.Response.End();
                return;
            }
            else
            {
                //2.获取用户变量
                string action = context.Request.QueryString["action"];

                //3.验证用户变量
                int id        = WX.Request.rDepartmentId;
                int companyID = WX.Request.rCompanyId;
                //4.处理业务

                if (action == "delete")
                {
                    string sql = String.Format("Select * from tu_Employees where DepartmentID={0}", id);
                    if (ULCode.QDA.XSql.IsHasRow(sql))
                    {
                        context.Response.Write("-3");
                        context.Response.End();
                        return;
                    }
                    sql = "DELETE FROM TE_Departments WHERE CompanyId=" + companyID + " AND ID=" + id;
                    System.Diagnostics.Debug.WriteLine(sql);
                    int row = XSql.Execute(sql);
                    //5.(用户及业务对象)统计与状态
                    if (row > 0)
                    {
                        WX.Model.Department.GetCache(id).RemoveFromCaches();
                        //6.登记日志
                        WX.Main.AddLog(LogType.Default, "部门信息删除成功!", "");
                        //7.返回页面
                        context.Response.Write("0");
                    }
                    else
                    {
                        context.Response.Write("1");
                    }
                }
            }
        }
        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 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);
        }
Example #25
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);
        }
Example #26
0
        /// <summary>
        /// 根据职务ID获取职务名称,职务用,分割
        /// </summary>
        /// <param name="dutyIdList">职务ID字符串</param>
        /// <returns>职务名称</returns>
        public static string GetDutyNameListByDutyIdList(string dutyIdList)
        {
            if (dutyIdList == "*")
            {
                return("所有职务");
            }
            string con = !string.IsNullOrEmpty(dutyIdList) ? " where ID in (" + dutyIdList + ")" : " where 1<>1";

            return(XSql.GetXDataTable("SELECT Name FROM TE_Duties" + con + "").ToColValueList());
        }
Example #27
0
        /// <summary>
        /// 根据部门ID获取部门名称,部门ID用,分割
        /// </summary>
        /// <param name="deptIdList">部门ID字符串</param>
        /// <returns>部门名称</returns>
        public static string GetDeptNameListByDeptIdList(string deptIdList)
        {
            if (deptIdList == "*")
            {
                return("所有部门");
            }
            string con = !string.IsNullOrEmpty(deptIdList) ? " where ID in (" + deptIdList + ")" : " where 1<>1";

            return(XSql.GetXDataTable("SELECT Name FROM TE_Departments" + con + "").ToColValueList());
        }
Example #28
0
        /// <summary>
        /// 根据用户ID获取用户姓名
        /// </summary>
        /// <param name="guidList">用户ID字符串,中间用,分割</param>
        /// <returns>用户姓名</returns>
        public static string GetRealNameListByUserIdList(string guidList)
        {
            if (guidList == "*")
            {
                return("所有人员");
            }
            string con = !string.IsNullOrEmpty(guidList)?" where UserID in ('" + guidList.Replace(",", "','") + "')":" where 1<>1";

            return(XSql.GetXDataTable("SELECT RealName FROM TU_Users" + con).ToColValueList());
        }
        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"));
        }
        protected void btnDelete_Command(object sender, CommandEventArgs e)
        {
            string supplierId = e.CommandArgument.ToString();
            int    row        = XSql.Execute("DELETE FROM Ass_Suppliers WHERE SupplierID=" + supplierId);

            if (row > 0)
            {
                ULCode.Debug.Alert("供应商信息删除成功!", "SupplierList.aspx");
            }
        }