예제 #1
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);
        }
예제 #2
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>");
                }
            }
        }
        protected void ASPxTreeList1_HtmlDataCellPrepared(object sender, TreeListHtmlDataCellEventArgs e)
        {
            if (e.Column.FieldName == "Status")
            {
                string fileName = string.Empty;
                switch ((string)e.CellValue)
                {
                case "deleted":
                    fileName = "~/Images/deleted.png";
                    break;

                case "saved":
                    fileName = "~/Images/saved.png";
                    break;
                }
                ASPxImage img = (ASPxImage)ASPxTreeList1.FindDataCellTemplateControl(e.NodeKey, e.Column, "ASPxImage1");
                if (fileName != string.Empty)
                {
                    img.ImageUrl = fileName;
                }
                else
                {
                    img.Visible = false;
                }
            }
        }
예제 #4
0
        protected void ASPxTreeList1_NodeUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            string rmes_id = e.Keys["RMES_ID"] as string;

            DetectBarCodeEntity entity = new DetectBarCodeEntity()
            {
                RMES_ID = rmes_id
            };

            entity.SEQ_VALUE  = e.NewValues["SEQ_VALUE"] as string;
            entity.SEQ_NAME   = e.NewValues["SEQ_NAME"] as string;
            entity.SEQ_FATHER = e.NewValues["SEQ_FATHER"] as string;
            entity.PLINE_CODE = e.NewValues["PLINE_CODE"] as string;
            if (string.IsNullOrEmpty(entity.SEQ_FATHER) || entity.SEQ_FATHER == "f001")
            {
                entity.SEQ_LEVEL = "1";
            }
            else
            {
                entity.SEQ_LEVEL = "2";
            }
            db.Update(entity);
            e.Cancel = true;
            ASPxTreeList1.CancelEdit();
            BindData();
        }
예제 #5
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();
            }
        }
    }
예제 #6
0
        public void getEmployeeTree()
        {
            int                keyValueTree      = 0;
            string             keySelectTree     = "";
            var                listSelectedNodes = ASPxTreeList1.GetSelectedNodes();
            Structure          oneStructure;
            Employee_Structure oneEmpStru;

            foreach (var oneSelectNode in listSelectedNodes)
            {
                oneStructure = new Structure();
                oneEmpStru   = new Employee_Structure();
                keyValueTree = int.Parse(oneSelectNode.Key);
                oneStructure = db.Structures.FirstOrDefault(x => x.Structure_Parent == keyValueTree && x.Is_Job_Title == true && x.Is_Manager == true);
                if (oneStructure != null)
                {
                    keyValueTree = oneStructure.Structure_Id;
                    oneEmpStru   = db.Employee_Structure.FirstOrDefault(x => x.Structure_Id == keyValueTree && x.Status_Structure == true);
                    if (oneEmpStru != null)
                    {
                        if (currentStructureUserId != oneEmpStru.Employee_Structure_Id)
                        {
                            keySelectTree = oneEmpStru.Employee_Structure_Id.ToString();
                            treatmentTo.Items.FindByValue(keySelectTree).Selected = true;
                        }
                    }
                }
            }
        }
예제 #7
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();
        }
    }
예제 #8
0
        protected void treeList_CustomDataCallback(object sender, TreeListCustomDataCallbackEventArgs e)
        {
            string       key  = e.Argument.ToString();
            TreeListNode node = ASPxTreeList1.FindNodeByKeyValue(key);

            e.Result = GetEntryText(node);
        }
예제 #9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack && !IsCallback)
     {
         ASPxTreeList1.DataBind();
         ASPxTreeList1.ExpandAll();
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ASPxTreeList1.DataBind();
         ASPxTreeList1.ExpandToLevel(2);
     }
 }
예제 #11
0
        protected void ASPxTreeList1_CommandColumnButtonInitialize(object sender, DevExpress.Web.ASPxTreeList.TreeListCommandColumnButtonEventArgs e)
        {
            TreeListNode node = ASPxTreeList1.FindNodeByKeyValue(e.NodeKey.ToString());

            if (node.Level == 1)
            {
                e.Visible = DefaultBoolean.False;
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     for (int i = 1; i <= 5; i++)
     {
         TreeListNode node = ASPxTreeList1.AppendNode(i);
         node.SetValue("Name", String.Format("Node {0}", i));
     }
     ((TreeListDataColumn)ASPxTreeList1.Columns["colTemp1"]).DataCellTemplate = new CellLinkTemplate();
 }
 protected void ASPxTreeList1_CustomCallback(object sender, DevExpress.Web.ASPxTreeList.TreeListCustomCallbackEventArgs e)
 {
     string[] param = e.Argument.Split(';');
     if (param.Length == 2 && param[0] == "UpdateAndEdit")
     {
         ASPxTreeList1.UpdateEdit();
         ASPxTreeList1.StartEdit(param[1]);
     }
 }
예제 #14
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();
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            TreeListNode nodeRoot = ASPxTreeList1.AppendNode(1);

            nodeRoot.SetValue("Column1", "root");
            TreeListNode nodeChild = ASPxTreeList1.AppendNode(2, nodeRoot);

            nodeChild.SetValue("Column1", "child");
            ASPxTreeList1.ExpandAll();
        }
예제 #16
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();
        }
예제 #17
0
    protected void ASPxTreeList1_CustomCallback(object sender, TreeListCustomCallbackEventArgs e)
    {
        ASPxTreeList1.CollapseAll();
        TreeListNode node = ASPxTreeList1.FindNodeByKeyValue(e.Argument);

        while (node.ParentNode != null)
        {
            node.Expanded = true;
            node          = node.ParentNode;
        }
    }
    protected void DisableParentNodeSelection()
    {
        // Iterates through all nodes and prevents the display of selection check boxes within parent nodes
        TreeListNodeIterator iterator = ASPxTreeList1.CreateNodeIterator();
        TreeListNode         node     = iterator.GetNext();

        while (node != null)
        {
            node.AllowSelect = !node.HasChildren;
            node             = iterator.GetNext();
        }
    }
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (ASPxTreeList1.SelectionCount == 0)
     {
         Label2.Text = "None";
     }
     else
     {
         TreeListNode node = ASPxTreeList1.GetSelectedNodes()[0];
         Label2.Text = node["Department"].ToString();
     }
 }
예제 #20
0
    protected void ASPxTreeList1_CommandColumnButtonInitialize(object sender, TreeListCommandColumnButtonEventArgs e)
    {
        if (e.ButtonType != TreeListCommandColumnButtonType.Delete)
        {
            return;
        }

        if (ASPxTreeList1.FindNodeByKeyValue(e.NodeKey).ChildNodes.Count != 0)
        {
            e.Visible = DevExpress.Utils.DefaultBoolean.False;
        }
    }
    protected void Page_Init(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Session.Clear();
        }

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

        ASPxTreeList1.ExpandAll();
    }
예제 #22
0
    //void ASPxTreeList1_NodeValidating(object sender, DevExpress.Web.ASPxTreeList.TreeListNodeValidationEventArgs e)
    //{
    //    string result = this.parseMenuData(true,
    //        e.IsNewNode ? operate.AddNew : operate.Update,
    //        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.NodeError = result;
    //}

    //void ASPxTreeList1_NodeDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
    //{

    //    string result = this.parseMenuData(false,
    //      operate.Delete,
    //      theCompanyCode,
    //      O2S(e.Values["MENU_CODE"]),
    //      O2S(e.Values["MENU_NAME"]),
    //      O2S(e.Values["MENU_NAME_EN"]),
    //      O2S(e.Values["MENU_CODE_FATHER"]),
    //      O2S(e.Values["MENU_LEVEL"]),
    //      O2S(e.Values["MENU_INDEX"]),
    //      O2S(e.Values["LEAF_FLAG"]),
    //      O2S(e.Values["PROGRAM_CODE"])
    //      );
    //    if (result.Length > 0)
    //    {
    //        e.Cancel = false;
    //    }
    //    else
    //    {
    //        ASPxTreeList1.CancelEdit();
    //        e.Cancel = true;
    //        bindData();
    //    }
    //}

    void ASPxTreeList1_NodeUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
    {
        string project = e.OldValues["项目代号"].ToString();
        string batch   = e.OldValues["批次"].ToString();
        string plan    = e.OldValues["工作号"].ToString();
        int    num     = int.Parse(e.OldValues["工艺序号"].ToString());
        //string oldTeam = e.OldValues["TEAM_CODE"].ToString();
        string team = e.NewValues["TEAM_CODE"].ToString();

        string sql = "";

        if (e.OldValues["TEAM_CODE"] == null)
        {
            sql = "INSERT INTO REL_PROCESS_TEAM(RMES_ID, PROJECT_CODE, BATCH_WORK_CODE, PLAN_CODE, PROCESS_NUM, TEAM_CODE)"
                  + " VALUES(SEQ_RMES_ID.NEXTVAL,'" + project + "','" + batch + "','" + plan + "'," + num + ",'" + team + "')";
        }
        else
        {
            sql = "UPDATE REL_PROCESS_TEAM SET TEAM_CODE ='" + team + "' WHERE PROCESS_NUM = " + num;
        }

        dataConn dc = new dataConn();

        dc.ExeSql(sql);

        ASPxTreeList1.CancelEdit();
        e.Cancel = true;
        bindData();

        //string result = this.parseMenuData(false,
        //  operate.Update,
        //  theCompanyCode,
        //  O2S(e.OldValues["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();
        //}
    }
예제 #23
0
 private void BuildTree()
 {
     try
     {
         var _Catss = st.Load_sitemap();
         ASPxTreeList1.DataSource = _Catss;
         ASPxTreeList1.DataBind();
     }
     catch (Exception ex)
     {
         clsVproErrorHandler.HandlerError(ex);
     }
 }
예제 #24
0
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     if (!IsPostBack)
     {
         ASPxTreeList1.DataBind();
         ASPxTreeList1.ExpandToLevel(2);
     }
     if (IsPostBack)
     {
         SaveState();
     }
 }
        protected void ASPxGridView1_FocusedRowChanged(object sender, EventArgs e)
        {
            object key = ASPxGridView1.GetRowValues(ASPxGridView1.FocusedRowIndex, "ID");

            if (key != null)
            {
                DevExpress.Web.ASPxTreeList.TreeListNode node = ASPxTreeList1.FindNodeByKeyValue(key.ToString());
                if (node != null)
                {
                    node.Focus();
                }
            }
        }
예제 #26
0
        protected void ASPxTreeList1_NodeDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
        {
            string rmes_id             = e.Values["RMES_ID"] as string;
            DetectBarCodeEntity entity = new DetectBarCodeEntity()
            {
                RMES_ID = rmes_id
            };

            db.Delete(entity);
            e.Cancel = true;
            ASPxTreeList1.CancelEdit();
            BindData();
        }
예제 #27
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();
        }
 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);
     }
 }
예제 #29
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();
        }
예제 #30
0
 void Bind()
 {
     if (Session[Key] != null)
     {
         try {
             XmlDataSource1.Data        = Session[Key].ToString();
             ASPxTreeList1.DataSourceID = XmlDataSource1.ID;
             ASPxTreeList1.DataBind();
         } catch {
             Session[Key] = null;
             throw;
         }
     }
 }