示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Cookies["user"] == null)
            {
                Response.Redirect("~/Default.aspx");
            }
            else
            {
                if (!new UserSecurity().CheckFormPermission((int)Global.formSecurity.AllGLAccounts, Request.Cookies["user"]["Permission"].ToString()))
                {
                    Response.Redirect("~/Finance_Module/UnAuthorized.aspx");
                }
            }
            if (!IsPostBack)
            {
                ASPxTreeList1.DataBind();
                TreeListNode firstUnread = ASPxTreeList1.FindNodeByFieldValue("IsNew", true);
                //  firstUnread.Focus();
                ASPxTreeList1.ExpandToLevel(2);
            }
            GLAccount gl = new GLAccount();
            DataTable dt = gl.getList();

            ASPxTreeList1.DataSource = dt;
            ASPxTreeList1.DataBind();
            AddSubmitEvent();
            if (!IsPostBack)
            {
                if (Request.QueryString["alert"] == "success")
                {
                    Response.Write("<script>alert('تم الحفظ بنجاح.');</script>");
                }
            }
        }
示例#2
0
    void SaveState()
    {
        const string prefix = "mycheck_";

        foreach (string key in Request.Params)
        {
            string value = Request.Params[key];
            if (key == "myradio")
            {
                StartNodeKey = value;
            }
            if (key.StartsWith(prefix) && !string.IsNullOrEmpty(value))
            {
                string nodeKey = key.Substring(prefix.Length);
                if (value == "H")
                {
                    HiddenNodeList.Add(nodeKey);
                }
                else if (value == "V")
                {
                    HiddenNodeList.Remove(nodeKey);
                }
                ASPxTreeList1.DataBind();
            }
        }
    }
示例#3
0
        protected void BayiEditPopup_WindowCallback(object source, DevExpress.Web.PopupWindowCallbackArgs e)
        {
            var  roleGuid = e.Parameter.ToString();
            Guid guid     = new Guid(roleGuid);
            var  list2    = db.S_MenuYetkileri(3, guid).ToList();

            if (list2.Count > 0)
            {
                ASPxTreeList1.DataSource = list2;
            }
            else
            {
                ASPxTreeList1.DataSource = null;
            }

            ASPxTreeList1.DataBind();
            ASPxTreeList1.SettingsSelection.Recursive = true;
            ASPxTreeList1.ExpandToLevel(2);

            foreach (var item in list2.ToList())
            {
                if ((bool)item.Checkbox)
                {
                    ASPxTreeList1.FindNodeByFieldValue("ID", item.ID).Selected = true;
                }
                else
                {
                    ASPxTreeList1.FindNodeByFieldValue("ID", item.ID).Selected = false;
                }
            }

            RoleEditPopup.JSProperties["cpEmployeeID"] = roleGuid;
            RoleEditPopup.JSProperties["cpHeaderText"] = string.Format("Role Düzenle, ({0} {1})", "Guid", roleGuid);
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ASPxTreeList1.DataBind();
         ASPxTreeList1.ExpandToLevel(2);
     }
 }
示例#5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack && !IsCallback)
     {
         ASPxTreeList1.DataBind();
         ASPxTreeList1.ExpandAll();
     }
 }
示例#6
0
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     session = new Session();
     XpoDataSource1.Session        = session;
     ASPxTreeList1.KeyFieldName    = "Oid";
     ASPxTreeList1.ParentFieldName = "Parent!Key";
     ASPxTreeList1.DataBind();
 }
示例#7
0
        protected void Page_Init(object sender, EventArgs e)
        {
            var datasource = new[]
            {
                new { OrganizationId = 1, ParentOrganizationId = 0, name = "Kho 1", Description = "Phòng Nhân sự", Email = "*****@*****.**", Address = "Phòng Nhân sự", PhoneNo = "123456879" },
                new { OrganizationId = 2, ParentOrganizationId = 1, name = "Dãy 1.1", Description = "Phòng Kế toán", Email = "*****@*****.**", Address = "Phòng Nhân sự", PhoneNo = "123456879" },
                new { OrganizationId = 3, ParentOrganizationId = 2, name = "Kệ 1.1.1", Description = "Bộ phận Kế toán tổng hợp", Email = "*****@*****.**", Address = "Bộ phận Kế toán tổng hợp", PhoneNo = "123456879" },
                new { OrganizationId = 4, ParentOrganizationId = 3, name = "Học1.1.1.1", Description = "Bộ phận Kế toán nội bộ", Email = "*****@*****.**", Address = "Bộ phận Kế toán nội bộ", PhoneNo = "123456879" }
            };

            ASPxTreeList1.DataSource = datasource;
            ASPxTreeList1.DataBind();
            grdData0.DataSource =
                new[] {
                new { key    = "123", code = "ML0001", name = "Nguyễn văn A", date = "25-07-2013", warehouse = "Kho1",
                      status = "Đã sắp xếp" },
                new { key    = "1234", code = "ML0002", name = "Nguyễn văn B", date = "25-07-2013", warehouse = "Kho2",
                      status = "Chưa sắp xếp" },
            };
            grdData0.KeyFieldName = "key";
            grdData0.DataBind();

            //grdData.DataSource =
            //  new[] {
            //         new { key="123", code = "MAT001", name = "Mặt hàng 1", lot="123", date="25-5-2014", reciept = "HD001",
            //                 recieptamount="100", unit="Thùng", description = "Mặt hàng 1"
            //        },
            //        new { key="1234", code = "MAT002", name = "Mặt hàng 2", lot="1234", date="25-7-2015",reciept = "HD001",
            //                 recieptamount="150", unit="Hộp", description = "Mặt hàng 2"
            //        },
            //    };
            //grdData.KeyFieldName = "key";
            //grdData.DataBind();

            grdDataAccept.DataSource =
                new[] {
                new { key        = "123", code = "MAT001", name = "Mặt hàng 1", lot = "123", reciept = "HD001", date = "25/09/2014",
                      sortamount = "90", realamount = "90", difamount = "10", unit = "Thùng", description = "Mặt hàng 1" },
                new { key        = "1234", code = "MAT002", name = "Mặt hàng 2", lot = "1234", reciept = "HD001", date = "25/09/2014",
                      sortamount = "130", realamount = "130", difamount = "20", unit = "Hộp", description = "Mặt hàng 2" },
            };
            grdDataAccept.KeyFieldName = "key";
            grdDataAccept.DataBind();

            ASPxGridView1.DataSource =
                new[] {
                new { key           = "123", code = "MAT001", name = "Mặt hàng 1", lot = "123", date = "25-5-2014", reciept = "HD001",
                      recieptamount = "100", unit = "Thùng", description = "Mặt hàng 1", position = "Kho 1; Dãy B; Kệ 5" },
                new { key           = "1234", code = "MAT002", name = "Mặt hàng 2", lot = "1234", date = "25-7-2015", reciept = "HD001",
                      recieptamount = "150", unit = "Hộp", description = "Mặt hàng 2", position = "Kho 1; Dãy B; Kệ 6" },
            };
            ASPxGridView1.KeyFieldName = "key";
            ASPxGridView1.DataBind();
        }
    protected void Page_Init(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Session.Clear();
        }

        ASPxTreeList1.DataSource = DataHelper.GetData();
        ASPxTreeList1.DataBind();

        ASPxTreeList1.ExpandAll();
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ASPxTreeList1.DataBind();
         ASPxTreeList1.ExpandAll();
         if (ASPxTreeList1.FocusedNode == null)
         {
             ASPxTreeList1.Nodes[0].Focus();
         }
         ASPxTreeList1.StartEdit(ASPxTreeList1.FocusedNode.Key);
     }
 }
示例#10
0
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     if (!IsPostBack)
     {
         ASPxTreeList1.DataBind();
         ASPxTreeList1.ExpandToLevel(2);
     }
     if (IsPostBack)
     {
         SaveState();
     }
 }
示例#11
0
 private void BuildTree()
 {
     try
     {
         var _Catss = st.Load_sitemap();
         ASPxTreeList1.DataSource = _Catss;
         ASPxTreeList1.DataBind();
     }
     catch (Exception ex)
     {
         clsVproErrorHandler.HandlerError(ex);
     }
 }
示例#12
0
        /*
         * UnitOfWork uow;
         * ViewProduct viewProduct;
         * ViewProductSupplier viewProductSupplier;
         *
         * Product product;
         * ProductProperty productProperty;
         * ProductSupplier productSupplier;
         * Manufacturer manufacturer;
         * Supplier supplier;
         */
        // sqlConnection.ConnectionString = ConfigurationManager.ConnectionStrings["SqlConnectString"].ToString();
        // Customer function

        /*
         * private bool validate()
         * {
         *  bool isValid = true;
         *
         *  uow = new UnitOfWork(ConnectionHelper.GetDataLayer(DevExpress.Xpo.DB.AutoCreateOption.SchemaAlreadyExists));
         *  viewProduct = (ViewProduct)Session["productMode"];
         *
         *  string oldCode = "";
         *  string oldName = "";
         *
         *  if (viewProduct != null)
         *  {
         *      oldCode = viewProduct.Code;
         *      oldName = viewProduct.Name;
         *  }
         *
         *  product = uow.FindObject<Product>(new BinaryOperator("Code", txtCode.Text));
         *
         *  if (product != null && oldCode != txtCode.Text)
         *  {
         *      txtCode.ValidationSettings.ErrorText = "Mã Hàng Hóa này đã tồn tại !";
         *      isValid = false;
         *  }
         *
         *  productProperty = uow.FindObject<ProductProperty>(new BinaryOperator("Name", txtName.Text));
         *
         *  if (productProperty != null && oldName != txtName.Text)
         *  {
         *      txtName.ValidationSettings.ErrorText = "Tên Hàng Hóa này đã tồn tại !";
         *      isValid = false;
         *  }
         *
         *  return isValid;
         * }
         */
        private void BindGrid()
        {
            var datasource = new[]
            {
                new { OrganizationId = 1, ParentOrganizationId = 0, code = "MS001", name = "Thùng lớn", Description = "Thùng lớn là đơn vị tính cao nhất", amount = "" },
                new { OrganizationId = 2, ParentOrganizationId = 1, code = "LT002", name = "Hợp lớn", Description = "1 Thùng lớn chứa 20 Hộp lớn", amount = "20" },
                new { OrganizationId = 3, ParentOrganizationId = 2, code = "LT003", name = "Vĩ", Description = "1 Hộp lớn chứa 30 Vĩ", amount = "30" },
                new { OrganizationId = 4, ParentOrganizationId = 3, code = "LT004", name = "Viên nén tròn", Description = "1 Vĩ chứa 12 Viên nén tròn", amount = "12" }
            };

            ASPxTreeList1.DataSource = datasource;
            ASPxTreeList1.DataBind();
        }
示例#13
0
        private void BindGrid()
        {
            var datasource = new[]
            {
                new { OrganizationId = 1, ParentOrganizationId = 0, code = "LT001", name = "Khu 1", Description = "Khu 1 là đơn vị lưu trữ cao nhất", amount = "" },
                new { OrganizationId = 2, ParentOrganizationId = 1, code = "LT002", name = "Dãy", Description = "Mỗi Khu 1 có 5 Dãy", amount = "5" },
                new { OrganizationId = 3, ParentOrganizationId = 2, code = "LT003", name = "Kệ", Description = "Mỗi Dãy có 7 Kệ", amount = "7" },
                new { OrganizationId = 4, ParentOrganizationId = 3, code = "LT004", name = "Học", Description = "Mỗi Kệ có 10 Học", amount = "10" }
            };

            ASPxTreeList1.DataSource = datasource;
            ASPxTreeList1.DataBind();
        }
示例#14
0
        protected void Page_Init(object sender, EventArgs e)
        {
            object[] grdDataSource = new[] {
                new { key           = "123", code = "MAT001", name = "Mặt hàng 1", lot = "123", reciept = "HD001",
                      recieptamount = "100", realamount = "90", difamount = "10", unit = "Thùng", description = "Mặt hàng 1",
                      entry         = "Đã điều chỉnh" },
                new { key           = "1234", code = "MAT002", name = "Mặt hàng 2", lot = "1234", reciept = "HD001",
                      recieptamount = "150", realamount = "130", difamount = "20", unit = "Hộp", description = "Mặt hàng 2",
                      entry         = "Chưa điều chỉnh" },
            };

            /*StreamReader reader = new StreamReader(Server.MapPath("/Purchasing/datasource/hierarchy.xml"));
             * try
             * {
             *  XmlDataSource1.Data = reader.ReadToEnd();
             * }
             * finally
             * {
             *  reader.Close();
             * }
             * ASPxTreeList1.DataSourceID = "XmlDataSource1";*/
            var datasource = new[]
            {
                new { OrganizationId = 1, ParentOrganizationId = 0, name = "Kho 1", Description = "Phòng Nhân sự", Email = "*****@*****.**", Address = "Phòng Nhân sự", PhoneNo = "123456879" },
                new { OrganizationId = 2, ParentOrganizationId = 1, name = "Dãy 1.1", Description = "Phòng Kế toán", Email = "*****@*****.**", Address = "Phòng Nhân sự", PhoneNo = "123456879" },
                new { OrganizationId = 3, ParentOrganizationId = 2, name = "Kệ 1.1.1", Description = "Bộ phận Kế toán tổng hợp", Email = "*****@*****.**", Address = "Bộ phận Kế toán tổng hợp", PhoneNo = "123456879" },
                new { OrganizationId = 4, ParentOrganizationId = 3, name = "Học1.1.1.1", Description = "Bộ phận Kế toán nội bộ", Email = "*****@*****.**", Address = "Bộ phận Kế toán nội bộ", PhoneNo = "123456879" }
            };

            ASPxTreeList1.DataSource = datasource;
            ASPxTreeList1.DataBind();

            grdData.DataSource = grdDataSource;

            grdData.KeyFieldName = "key";
            grdData.DataBind();

            grvConfirmData.DataSource = grdDataSource;
            grvConfirmData.DataBind();

            grdDataAccept.DataSource =
                new[] {
                new { key           = "123", code = "MAT001", name = "Mặt hàng 1", lot = "123", reciept = "HD001",
                      recieptamount = "90", realamount = "90", difamount = "10", unit = "Thùng", description = "Mặt hàng 1" },
                new { key           = "1234", code = "MAT002", name = "Mặt hàng 2", lot = "1234", reciept = "HD001",
                      recieptamount = "130", realamount = "130", difamount = "20", unit = "Hộp", description = "Mặt hàng 2" },
            };
            grdDataAccept.KeyFieldName = "key";
            grdDataAccept.DataBind();
        }
示例#15
0
 void Bind()
 {
     if (Session[Key] != null)
     {
         try {
             XmlDataSource1.Data        = Session[Key].ToString();
             ASPxTreeList1.DataSourceID = XmlDataSource1.ID;
             ASPxTreeList1.DataBind();
         } catch {
             Session[Key] = null;
             throw;
         }
     }
 }
示例#16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var datasource = new[]
            {
                new { OrganizationId = 1, ParentOrganizationId = 0, LoaiTaiKhoan = "Tài Sản Lưu Động", SoTaiKhoan = "111", Cap = "1", TenTaiKhoan = "Tiền Mặt", GhiChu = "Là Tài Khoản Tiền Mặt" },
                new { OrganizationId = 2, ParentOrganizationId = 1, LoaiTaiKhoan = "Tài Sản Lưu Động", SoTaiKhoan = "1111", Cap = "2", TenTaiKhoan = "Tiền Việt Nam", GhiChu = "Là Tài Khoản Tiền Việt Nam" },
                new { OrganizationId = 3, ParentOrganizationId = 1, LoaiTaiKhoan = "Tài Sản Lưu Động", SoTaiKhoan = "1112", Cap = "2", TenTaiKhoan = "Ngoại Tệ", GhiChu = "Là Ngoại Tệ" },
                new { OrganizationId = 4, ParentOrganizationId = 0, LoaiTaiKhoan = "Tài Sản Lưu Động", SoTaiKhoan = "112", Cap = "1", TenTaiKhoan = "Tiền Gửi Ngân Hàng", GhiChu = "Là Tiền Gửi Ngân Hàng" },
                new { OrganizationId = 5, ParentOrganizationId = 4, LoaiTaiKhoan = "Tài Sản Lưu Động", SoTaiKhoan = "1121", Cap = "2", TenTaiKhoan = "Tiền Việt Nam", GhiChu = "Là Tài Khoản Tiền Việt Nam" },
                new { OrganizationId = 6, ParentOrganizationId = 4, LoaiTaiKhoan = "Tài Sản Lưu Động", SoTaiKhoan = "1122", Cap = "2", TenTaiKhoan = "Ngoại Tệ", GhiChu = "Là Ngoại Tệ" },
                new { OrganizationId = 7, ParentOrganizationId = 3, LoaiTaiKhoan = "Tài Sản Lưu Động", SoTaiKhoan = "1112.1", Cap = "3", TenTaiKhoan = "Vàng Bạc, Kim Khí Quí, Đá Quí", GhiChu = "Là Vàng Bạc, Kim Khí Quí, Đá Quí" }
            };

            ASPxTreeList1.DataSource = datasource;
            ASPxTreeList1.DataBind();
        }
示例#17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var datasource = new[]
            {
                new { OrganizationId = 1, ParentOrganizationId = 0, name = "Kho 1", Description = "Phòng Nhân sự", Email = "*****@*****.**", Address = "Phòng Nhân sự", PhoneNo = "123456879" },
                new { OrganizationId = 2, ParentOrganizationId = 1, name = "Dãy 1.1", Description = "Phòng Kế toán", Email = "*****@*****.**", Address = "Phòng Nhân sự", PhoneNo = "123456879" },
                new { OrganizationId = 3, ParentOrganizationId = 2, name = "Kệ 1.1.1", Description = "Bộ phận Kế toán tổng hợp", Email = "*****@*****.**", Address = "Bộ phận Kế toán tổng hợp", PhoneNo = "123456879" },
                new { OrganizationId = 4, ParentOrganizationId = 3, name = "Học1.1.1.1", Description = "Bộ phận Kế toán nội bộ", Email = "*****@*****.**", Address = "Bộ phận Kế toán nội bộ", PhoneNo = "123456879" }
            };

            ASPxTreeList1.DataSource = datasource;
            ASPxTreeList1.DataBind();

            InitPivotGrid();
            BindChart();
        }
示例#18
0
        protected void Save_Click(object sender, EventArgs e)
        {
            int parent = 0;

            int.TryParse(Parent.SelectedValue.ToString(), out parent);


            bool result = insert_tree_record(Name_Ar.Text, Name_En.Text, parent);

            if (result)
            {
                ASPxTreeList1.DataBind();
                Parent.DataBind();
                Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "HideTheModel(); notify('top', 'right', 'fa fa-check', 'success', 'animated fadeInRight', 'animated fadeOutRight','  Save Status : ','  The new Structure was Sucessfully saved in system ! ');", true);
            }
        }
        private void BindTreeList()
        {
            ASPxTreeList1.DataSource   = GetData();
            ASPxTreeList1.KeyFieldName = "ID";

            ASPxTreeList1.ParentFieldName = "ParentID";
            ASPxTreeList1.EnableCallbacks = false;
            ASPxTreeList1.SettingsBehavior.AllowFocusedNode = true;
            ASPxTreeList1.SettingsBehavior.ProcessFocusedNodeChangedOnServer = true;
            if (ASPxTreeList1.Columns.Count == 0)
            {
                DevExpress.Web.ASPxTreeList.TreeListDataColumn col = new DevExpress.Web.ASPxTreeList.TreeListDataColumn();
                col.FieldName = "Name";
                ASPxTreeList1.Columns.Add(col);
            }
            ASPxTreeList1.DataBind();
        }
示例#20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            grid_productgrp.DataSource = new[] {
                new{
                    productgrp_id   = "MNHH0001",
                    productgrp_name = "Nhóm đặc trị 1",
                    description     = "",
                    note            = ""
                },
                new{
                    productgrp_id   = "MNHH0002",
                    productgrp_name = "Nhóm đặc trị 2",
                    description     = "",
                    note            = ""
                },
                new{
                    productgrp_id   = "MNHH0003",
                    productgrp_name = "Nhóm đặc trị 3",
                    description     = "",
                    note            = ""
                },
            };

            grid_productgrp.DataBind();

            grid_manufacturer.DataSource = new[] {
                new { supplierid   = "MNCC00009",
                      suppliername = "Nhà cung cấp 9",
                      description  = "" },
                new { supplierid   = "MNCC00010",
                      suppliername = "Nhà cung cấp 10",
                      description  = "" },
            };
            grid_manufacturer.DataBind();

            var datasource = new[]
            {
                new { OrganizationId = 1, ParentOrganizationId = 0, code = "MS001", name = "Thùng lớn", description = "Thùng lớn là đơn vị tính cao nhất", amount = "" },
                new { OrganizationId = 2, ParentOrganizationId = 1, code = "LT002", name = "Hợp lớn", description = "1 Thùng lớn chứa 20 Hộp lớn", amount = "20" },
                new { OrganizationId = 3, ParentOrganizationId = 2, code = "LT003", name = "Vĩ", description = "1 Hộp lớn chứa 30 Vĩ", amount = "30" },
                new { OrganizationId = 4, ParentOrganizationId = 3, code = "LT004", name = "Viên nén tròn", description = "1 Vĩ chứa 12 Viên nén tròn", amount = "12" }
            };

            ASPxTreeList1.DataSource = datasource;
            ASPxTreeList1.DataBind();
        }
示例#21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AccountingBO accountBO = new AccountingBO();
            //accountBO.InitBalanceForward(session, AccountingPeriodBO.getCurrentAccountingPeriod(session));
            var datasource1 = accountBO.getLedgerListByAccountCategory(session, "ASSET");
            var datasource2 = accountBO.getLedgerListByAccountCategory(session, "LIABILITY");
            var datasource3 = accountBO.getLedgerListByAccountCategory(session, "EQUITY");

            ASPxTreeList1.DataSource = datasource1;
            ASPxTreeList2.DataSource = datasource2;
            ASPxTreeList3.DataSource = datasource3;

            ASPxTreeList1.DataBind();
            ASPxTreeList2.DataBind();
            ASPxTreeList3.DataBind();
            XPQuery <AccountCategory> AccCateQuery = session.Query <AccountCategory>();
            General gen = new General();

            AccountCategory AccCate = AccCateQuery.Where(r => r.Code == "ASSET").FirstOrDefault();

            totalAsset = gen.TotalBalance(session, AccCate);

            AccCate        = AccCateQuery.Where(r => r.Code == "LIABILITY").FirstOrDefault();
            totalLiability = gen.TotalBalance(session, AccCate);

            AccCate     = AccCateQuery.Where(r => r.Code == "EQUITY").FirstOrDefault();
            totalEquity = gen.TotalBalance(session, AccCate);
            ASPxTextBox tb1 = ASPxTreeList1.FindFooterTemplateControl(ASPxTreeList1.Columns[2], "AssetTotal") as ASPxTextBox;

            tb1.Value = ParseStringNumber(totalAsset.ToString());
            tb1.Text  = ParseStringNumber(totalAsset.ToString());
            ASPxTextBox tb2 = ASPxTreeList2.FindFooterTemplateControl(ASPxTreeList2.Columns[2], "LiabilityTotal") as ASPxTextBox;

            tb2.Value = ParseStringNumber(totalLiability.ToString());
            tb2.Text  = ParseStringNumber(totalLiability.ToString());
            ASPxTextBox tb3 = ASPxTreeList3.FindFooterTemplateControl(ASPxTreeList3.Columns[2], "EquityTotal") as ASPxTextBox;

            tb3.Value = ParseStringNumber(totalEquity.ToString());
            tb3.Text  = ParseStringNumber(totalEquity.ToString());
            ASPxTextBox tb4 = ASPxTreeList3.FindFooterTemplateControl(ASPxTreeList3.Columns[2], "DebitTotal") as ASPxTextBox;

            tb4.Value = ParseStringNumber((totalLiability + totalEquity).ToString());
            tb4.Text  = ParseStringNumber((totalLiability + totalEquity).ToString());
        }
示例#22
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //AccountType accountType = session.GetObjectByKey<AccountType>(cbAccountType.Value);
     //CriteriaOperator criteria;
     //criteria = new BinaryOperator("AccountTypeId", accountType.AccountTypeId);
     //AccountXPO.Criteria = criteria.ToString();
     ASPxTreeList1.DataSourceID = "AccountXPO";
     ASPxTreeList1.KeyFieldName = "AccountId";
     ASPxTreeList1.DataBind();
     //if (cbAccountType.Value != null)
     //{
     //    if (cbAccountType.Value.ToString() != "")
     //    {
     //        Guid guid = Guid.Parse(cbAccountType.Value.ToString());
     //        AccountType accountType = session.GetObjectByKey<AccountType>(guid);
     //        CriteriaOperator criteria = new BinaryOperator("AccountTypeId!Key", accountType.AccountTypeId);
     //        AccountXPO.Criteria = criteria.ToString();
     //        ASPxTreeList1.DataBind();
     //    }
     //}
 }
示例#23
0
    /// <summary>
    /// 绑定数据到AspxTreeList1
    /// </summary>
    private void bindData()
    {
        userManager theUserManager = (userManager)Session["theUserManager"];

        this.TranslateASPxControl(ASPxTreeList1);

        theCompanyCode = theUserManager.getCompanyCode();
        //theContentPrintSql = "SELECT * FROM CODE_MENU WHERE COMPANY_CODE='" + theCompanyCode + "' ORDER BY MENU_INDEX";

        //DataTable dt = conn.GetTable(theContentPrintSql);

        ASPxTreeList1.KeyFieldName    = "MENU_CODE";
        ASPxTreeList1.ParentFieldName = "MENU_CODE_FATHER";


        ASPxTreeList1.SettingsEditing.Mode = DevExpress.Web.ASPxTreeList.TreeListEditMode.PopupEditForm;
        ASPxTreeList1.SettingsPopupEditForm.HorizontalAlign = DevExpress.Web.ASPxClasses.PopupHorizontalAlign.Center;

        ASPxTreeList1.SettingsPopupEditForm.VerticalOffset = 10;
        //caoly 20130110 改成离当前行下面10个像素正中间弹出修改或新增框,原来下面的一句是整个页面的正中间,不容易找到
        //ASPxTreeList1.SettingsPopupEditForm.VerticalAlign = DevExpress.Web.ASPxClasses.PopupVerticalAlign.WindowCenter;

        ASPxTreeList1.SettingsPopupEditForm.AllowResize = true;
        ASPxTreeList1.SettingsPopupEditForm.Modal       = true;
        ASPxTreeList1.SettingsPopupEditForm.Width       = 500;
        ASPxTreeList1.SettingsPopupEditForm.Caption     = "菜单编辑";

        //ASPxTreeList1.DataSource = dt;
        ASPxTreeList1.DataSource = MenuItemFactory.GetByCompany(theCompanyCode);
        ASPxTreeList1.DataBind();

        ASPxTreeList1.SettingsEditing.AllowNodeDragDrop = true;
        ASPxTreeList1.ProcessDragNode      += new DevExpress.Web.ASPxTreeList.TreeListNodeDragEventHandler(ASPxTreeList1_ProcessDragNode);
        ASPxTreeList1.CellEditorInitialize += new DevExpress.Web.ASPxTreeList.TreeListColumnEditorEventHandler(ASPxTreeList1_CellEditorInitialize);
        ASPxTreeList1.NodeValidating       += new DevExpress.Web.ASPxTreeList.TreeListNodeValidationEventHandler(ASPxTreeList1_NodeValidating);
        ASPxTreeList1.NodeInserting        += new DevExpress.Web.Data.ASPxDataInsertingEventHandler(ASPxTreeList1_NodeInserting);
        ASPxTreeList1.NodeUpdating         += new DevExpress.Web.Data.ASPxDataUpdatingEventHandler(ASPxTreeList1_NodeUpdating);
        ASPxTreeList1.NodeDeleting         += new DevExpress.Web.Data.ASPxDataDeletingEventHandler(ASPxTreeList1_NodeDeleting);
    }
示例#24
0
    private void bindData()
    {
        userManager theUserManager = (userManager)Session["theUserManager"];

        this.TranslateASPxControl(ASPxTreeList1);

        theCompanyCode     = theUserManager.getCompanyCode();
        theContentPrintSql = "select * from code_work_unit";

        DataTable dt = conn.GetTable(theContentPrintSql);

        ASPxTreeList1.KeyFieldName         = "WORKUNIT_CODE";
        ASPxTreeList1.ParentFieldName      = "WORKUNIT_PARENTCODE";
        ASPxTreeList1.SettingsEditing.Mode = DevExpress.Web.ASPxTreeList.TreeListEditMode.PopupEditForm;
        ASPxTreeList1.SettingsPopupEditForm.HorizontalAlign = DevExpress.Web.ASPxClasses.PopupHorizontalAlign.Center;
        ASPxTreeList1.SettingsPopupEditForm.VerticalAlign   = DevExpress.Web.ASPxClasses.PopupVerticalAlign.WindowCenter;
        ASPxTreeList1.SettingsPopupEditForm.AllowResize     = true;
        ASPxTreeList1.SettingsPopupEditForm.Modal           = true;
        ASPxTreeList1.SettingsPopupEditForm.Width           = 500;
        ASPxTreeList1.SettingsPopupEditForm.Caption         = "工作单元编辑";

        ASPxTreeList1.DataSource = dt;
        ASPxTreeList1.DataBind();

        ASPxTreeList1.CollapseAll();
        ASPxTreeList1.ExpandToLevel(2);
        //ASPxTreeList1.SettingsEditing.AllowNodeDragDrop = true;
        //ASPxTreeList1.ProcessDragNode += new DevExpress.Web.ASPxTreeList.TreeListNodeDragEventHandler(ASPxTreeList1_ProcessDragNode);
        ASPxTreeList1.CellEditorInitialize += new DevExpress.Web.ASPxTreeList.TreeListColumnEditorEventHandler(ASPxTreeList1_CellEditorInitialize);
        //ASPxTreeList1.NodeValidating += new DevExpress.Web.ASPxTreeList.TreeListNodeValidationEventHandler(ASPxTreeList1_NodeValidating);
        //ASPxTreeList1.NodeInserting += new DevExpress.Web.Data.ASPxDataInsertingEventHandler(ASPxTreeList1_NodeInserting);
        ASPxTreeList1.NodeUpdating += new DevExpress.Web.Data.ASPxDataUpdatingEventHandler(ASPxTreeList1_NodeUpdating);
        //ASPxTreeList1.NodeDeleting += new DevExpress.Web.Data.ASPxDataDeletingEventHandler(ASPxTreeList1_NodeDeleting);

        //ASPxTreeList1.HtmlRowPrepared += new DevExpress.Web.ASPxTreeList.TreeListHtmlRowEventHandler(ASPxTreeList1_HtmlRowPrepared);
        //ASPxTreeList1.HtmlDataCellPrepared += new DevExpress.Web.ASPxTreeList.TreeListHtmlDataCellEventHandler(ASPxTreeList1_HtmlDataCellPrepared);
        //ASPxTreeList1.ParseValue += new DevExpress.Web.Data.ASPxParseValueEventHandler(ASPxTreeList1_ParseValue);
    }
示例#25
0
    //void ASPxTreeList1_NodeInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
    //{
    //    string result = this.parseMenuData(false,
    //      operate.AddNew,
    //      theCompanyCode,
    //      O2S(e.NewValues["MENU_CODE"]),
    //      O2S(e.NewValues["MENU_NAME"]),
    //      O2S(e.NewValues["MENU_NAME_EN"]),
    //      O2S(e.NewValues["MENU_CODE_FATHER"]),
    //      O2S(e.NewValues["MENU_LEVEL"]),
    //      O2S(e.NewValues["MENU_INDEX"]),
    //      O2S(e.NewValues["LEAF_FLAG"]),
    //      O2S(e.NewValues["PROGRAM_CODE"])
    //      );
    //    if (result.Length > 0)
    //    {
    //        e.Cancel = false;
    //    }
    //    else
    //    {
    //        ASPxTreeList1.CancelEdit();
    //        e.Cancel = true;
    //        bindData();
    //    }
    //}

    private void bindData()
    {
        userManager theUserManager = (userManager)Session["theUserManager"];

        this.TranslateASPxControl(ASPxTreeList1);

        theCompanyCode     = theUserManager.getCompanyCode();
        theContentPrintSql = "Select * from (SELECT A.*,B.TEAM_CODE FROM AAA12020 A LEFT JOIN REL_PROCESS_TEAM B ON A.工艺序号=B.PROCESS_NUM WHERE 装入序号 IS NOT NULL AND 批次=2 ORDER BY 装入序号,工艺序号) where rownum<6000";

        DataTable dt = conn.GetTable(theContentPrintSql);

        ASPxTreeList1.KeyFieldName         = "工艺序号";
        ASPxTreeList1.ParentFieldName      = "装入序号";
        ASPxTreeList1.SettingsEditing.Mode = DevExpress.Web.ASPxTreeList.TreeListEditMode.PopupEditForm;
        ASPxTreeList1.SettingsPopupEditForm.HorizontalAlign = DevExpress.Web.ASPxClasses.PopupHorizontalAlign.Center;
        ASPxTreeList1.SettingsPopupEditForm.VerticalAlign   = DevExpress.Web.ASPxClasses.PopupVerticalAlign.WindowCenter;
        ASPxTreeList1.SettingsPopupEditForm.AllowResize     = true;
        ASPxTreeList1.SettingsPopupEditForm.Modal           = true;
        ASPxTreeList1.SettingsPopupEditForm.Width           = 500;
        ASPxTreeList1.SettingsPopupEditForm.Caption         = "BOM编辑";

        ASPxTreeList1.DataSource = dt;
        ASPxTreeList1.DataBind();

        ASPxTreeList1.CollapseAll();
        ASPxTreeList1.ExpandToLevel(0);
        //ASPxTreeList1.SettingsEditing.AllowNodeDragDrop = true;
        //ASPxTreeList1.ProcessDragNode += new DevExpress.Web.ASPxTreeList.TreeListNodeDragEventHandler(ASPxTreeList1_ProcessDragNode);
        ASPxTreeList1.CellEditorInitialize += new DevExpress.Web.ASPxTreeList.TreeListColumnEditorEventHandler(ASPxTreeList1_CellEditorInitialize);
        //ASPxTreeList1.NodeValidating += new DevExpress.Web.ASPxTreeList.TreeListNodeValidationEventHandler(ASPxTreeList1_NodeValidating);
        //ASPxTreeList1.NodeInserting += new DevExpress.Web.Data.ASPxDataInsertingEventHandler(ASPxTreeList1_NodeInserting);
        ASPxTreeList1.NodeUpdating += new DevExpress.Web.Data.ASPxDataUpdatingEventHandler(ASPxTreeList1_NodeUpdating);
        //ASPxTreeList1.NodeDeleting += new DevExpress.Web.Data.ASPxDataDeletingEventHandler(ASPxTreeList1_NodeDeleting);

        //ASPxTreeList1.HtmlRowPrepared += new DevExpress.Web.ASPxTreeList.TreeListHtmlRowEventHandler(ASPxTreeList1_HtmlRowPrepared);
        //ASPxTreeList1.HtmlDataCellPrepared += new DevExpress.Web.ASPxTreeList.TreeListHtmlDataCellEventHandler(ASPxTreeList1_HtmlDataCellPrepared);
        //ASPxTreeList1.ParseValue += new DevExpress.Web.Data.ASPxParseValueEventHandler(ASPxTreeList1_ParseValue);
    }
示例#26
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ASPxTreeList1.DataBind();
     ASPxTreeList1.SettingsSelection.Recursive = true;
     ASPxTreeList1.ExpandToLevel(2);
 }
示例#27
0
 protected void ASPxTreeList1_NodeDeleted(object sender, DevExpress.Web.Data.ASPxDataDeletedEventArgs e)
 {
     ASPxTreeList1.DataBind();
     Parent.DataBind();
     TreeDataSourceView.DataBind();
 }
示例#28
0
        private void fillAllStructure()
        {
            List <Employee_Structure> ListEmployeeStructure10 = new List <Employee_Structure>();

            ListEmployeeStructure10 = loadSendEmployeeStructure();
            if (SessionWrapper.LoggedUser.Language_id == 1)
            {
                var dc1 = from c in ListEmployeeStructure10
                          where c.Employee_Id != currentUserId
                          select new
                {
                    ddlKey       = c.Employee_Structure_Id,
                    employeeName = c.Employee.Employee_Name_Ar,
                    jobTitle     = c.Structure.Structure_Name_Ar
                };

                ASPxGridView1.DataSource = dc1.ToList();
                ASPxGridView1.DataBind();

                ASPxGridView2.DataSource = dc1.ToList();
                ASPxGridView2.DataBind();
            }
            else
            {
                var dc1 = from c in ListEmployeeStructure10
                          where c.Employee_Id != currentUserId
                          select new
                {
                    ddlKey       = c.Employee_Structure_Id,
                    employeeName = c.Employee.Employee_Name_En,
                    jobTitle     = c.Structure.Structure_Name_En
                };

                ASPxGridView1.DataSource = dc1.ToList();
                ASPxGridView1.DataBind();

                ASPxGridView2.DataSource = dc1.ToList();
                ASPxGridView2.DataBind();
            }
            ////////////////////////////////////////////////////////////////////////////////////////////////

            ListStructure                 = loadTreeStructure();
            ASPxTreeList1.DataSource      = ListStructure;
            ASPxTreeList1.KeyFieldName    = "Structure_Id";
            ASPxTreeList1.ParentFieldName = "Structure_Parent";
            if (SessionWrapper.LoggedUser.Language_id == 1)
            {
                ASPxTreeList1.PreviewFieldName = "Structure_Name_Ar";
            }
            else
            {
                ASPxTreeList1.PreviewFieldName = "Structure_Name_En";
            }
            ASPxTreeList1.DataBind();

            ASPxTreeList2.DataSource      = ListStructure;
            ASPxTreeList2.KeyFieldName    = "Structure_Id";
            ASPxTreeList2.ParentFieldName = "Structure_Parent";
            if (SessionWrapper.LoggedUser.Language_id == 1)
            {
                ASPxTreeList2.PreviewFieldName = "Structure_Name_Ar";
            }
            else
            {
                ASPxTreeList2.PreviewFieldName = "Structure_Name_En";
            }
            ASPxTreeList2.DataBind();
        }
示例#29
0
    protected void ASPxMenu1_ItemClick(object source, DevExpress.Web.MenuItemEventArgs e)
    {
        String s = e.Item.Name;

        switch (s)
        {
        case "Item1":
            TreeLabel.Text = "СКЗ";
            if (!Page.User.IsInRole("Members"))
            {
                SqlDataSource22.SelectCommand = String.Format("SELECT subject_id, subject_name, subject_type, subject_code, object_name, add_info, latitude, longitude FROM \"Subject\" where subject_type='СКЗ' order by subject_name");
                TreeCommand = SqlDataSource22.SelectCommand;
            }
            ASPxTreeList1.DataBind();
            break;

        case "Item2":
            TreeLabel.Text = "БСЗ";
            if (!Page.User.IsInRole("Members"))
            {
                SqlDataSource22.SelectCommand = String.Format("SELECT subject_id, subject_name, subject_type, subject_code, object_name, add_info, latitude, longitude FROM \"Subject\" where subject_type='БСЗ' or subject_type='БКМУ+БСЗ' order by subject_name");
                TreeCommand = SqlDataSource22.SelectCommand;
                Page.ClientScript.RegisterStartupScript(this.GetType(), "BSZSet", "BSZSet()", true);
            }
            ASPxTreeList1.DataBind();
            break;

        case "Item3":
            TreeLabel.Text = "БКМУ";
            if (!Page.User.IsInRole("Members"))
            {
                SqlDataSource22.SelectCommand = String.Format("SELECT subject_id, subject_name, subject_type, subject_code, object_name, add_info, latitude, longitude FROM \"Subject\" where subject_type='БКМУ' order by subject_name");
                TreeCommand = SqlDataSource22.SelectCommand;
                Page.ClientScript.RegisterStartupScript(this.GetType(), "BKMUSet", "BKMUSet()", true);
            }
            ASPxTreeList1.DataBind();
            break;

        case "Item9":
            TreeLabel.Text = "Все объекты";
            if (!Page.User.IsInRole("Members"))
            {
                SqlDataSource22.SelectCommand = String.Format("SELECT subject_id, subject_name, subject_type, subject_code, object_name, add_info, latitude, longitude FROM \"Subject\"");
                TreeCommand = SqlDataSource22.SelectCommand;
                Page.ClientScript.RegisterStartupScript(this.GetType(), "AllSet", "AllSet()", true);
            }
            ASPxTreeList1.DataBind();
            break;

        case "Item4":
            TreeLabel.Text = "СДЗ";
            if (!Page.User.IsInRole("Members"))
            {
                SqlDataSource22.SelectCommand = String.Format("SELECT subject_id, subject_name, subject_type, subject_code, object_name, add_info, latitude, longitude FROM \"Subject\" where subject_type='СДЗ' order by subject_name");
                TreeCommand = SqlDataSource22.SelectCommand;
                Page.ClientScript.RegisterStartupScript(this.GetType(), "SDZSet", "SDZSet()", true);
            }
            ASPxTreeList1.DataBind();
            break;

        default:
            TreeLabel.Text = "";
            break;
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     ASPxTreeList1.DataBind();
     ASPxGridView1.DataBind();
 }