Example #1
0
        public override void Load(Keys Keys = null)
        {
            base.Load(Keys);

            DataTable Dt;

            if (Keys == null)
            {
                List <QueryParameter> Sp = new List <QueryParameter>();
                Sp.Add(new QueryParameter("@ID", 0));
                Dt = Do_Methods_Query.ExecuteQuery("usp_Rights_Details_Load", Sp).Tables[0];
            }
            else
            {
                Int64 ID = 0;
                try
                { ID = Keys["RightsID"]; }
                catch { }
                List <QueryParameter> Sp = new List <QueryParameter>();
                Sp.Add(new QueryParameter("@ID", ID));
                Dt = Do_Methods_Query.ExecuteQuery("usp_Rights_Details_Load", Sp).Tables[0];
            }

            this.AddRequired(Dt);
            this.pTableDetail_Set("Rights_Details", Dt);
        }
Example #2
0
        private void LoadMenu()
        {
            ClsSysCurrentUser CurrentUser = this.mMaster.pCurrentUser;
            DataTable         Dt_Menu;

            if (CurrentUser.pIsAdmin)
            {
                Dt_Menu = Do_Methods_Query.GetQuery("uvw_System_Modules", "", "IsNull(IsHidden,0) = 0", "Parent_OrderIndex, OrderIndex");
            }
            else
            {
                List <QueryParameter> Sp = new List <QueryParameter>();
                Sp.Add(new QueryParameter(@"@UserID", CurrentUser.pDrUser["UserID"]));
                Dt_Menu = Do_Methods_Query.ExecuteQuery("usp_System_Modules_Load", Sp).Tables[0];
            }

            this.trvMenus.Nodes.Clear();

            foreach (DataRow Dr in Dt_Menu.Rows)
            {
                if ((Int64)Do_Methods.IsNull(Dr["Parent_System_ModulesID"], 0) == 0)
                {
                    TreeNode Node = new TreeNode();
                    Node.Text = @"&nbsp" + Dr["Name"];
                    //Node.ImageUrl = "";
                    if ((string)Do_Methods.IsNull(Dr["PageUrl_List"], "") != "")
                    {
                        string Arguments = (string)Do_Methods.IsNull(Dr["Arguments"], "");
                        if (Arguments != "")
                        {
                            Arguments = @"?" + Arguments;
                        }
                        Node.NavigateUrl = @"~/" + Dr["PageUrl_List"] + Arguments;
                    }
                    else
                    {
                        Node.SelectAction = TreeNodeSelectAction.None;
                    }

                    this.trvMenus.Nodes.Add(Node);

                    DataRow[] ArrDr = Dt_Menu.Select("Parent_System_ModulesID = " + ((Int64)Do_Methods.IsNull(Dr["System_ModulesID"], 0)).ToString());
                    if (ArrDr.Length > 0)
                    {
                        this.AddNode(ref Dt_Menu, Node, (Int64)Do_Methods.IsNull(Dr["System_ModulesID"], 0));
                    }
                }
            }
        }
        public override bool Save(DataObjects_Framework.DataAccess.Interface_DataAccess Da = null)
        {
            bool Rv = base.Save(Da);

            Int64     ItemID = Do_Methods.Convert_Int64(this.pDr["ItemID"]);
            double    Price  = 0;
            DataTable Dt     = Do_Methods_Query.ExecuteQuery("Select Top 1 Price From Item_PriceHistory Where ItemID = " + ItemID + " Order By DatePosted").Tables[0];

            if (Dt.Rows.Count > 0)
            {
                Price = Do_Methods.Convert_Double(Dt.Rows[0]["Price"]);
            }

            if (Price != Do_Methods.Convert_Double(this.pDr["Price"], 0))
            {
                this.UpdatePriceHistory(ItemID);
            }

            return(Rv);
        }
Example #4
0
        public static string GetSeriesNo(string Name)
        {
            string    Rv = "";
            DataTable Dt;
            string    TableName;
            string    FieldName;
            string    Prefix;
            Int32     Digits;

            Dt = Do_Methods_Query.GetQuery("System_DocumentSeries", "", "ModuleName = '" + Name + "'");
            if (Dt.Rows.Count > 0)
            {
                TableName = (string)Do_Methods.IsNull(Dt.Rows[0]["TableName"], "");
                FieldName = (string)Do_Methods.IsNull(Dt.Rows[0]["FieldName"], "");
                Prefix    = (string)Do_Methods.IsNull(Dt.Rows[0]["Prefix"], "");
                Digits    = (Int32)Do_Methods.IsNull(Dt.Rows[0]["Digits"], "");
            }
            else
            {
                return(Rv);
            }

            List <QueryParameter> Sp = new List <QueryParameter>();

            Sp.Add(new QueryParameter("@TableName", TableName));
            Sp.Add(new QueryParameter("@FieldName", FieldName));
            Sp.Add(new QueryParameter("@Prefix", Prefix));
            Sp.Add(new QueryParameter("@Digits", Digits));

            Dt = Do_Methods_Query.ExecuteQuery("usp_GetSeriesNo", Sp).Tables[0];
            if (Dt.Rows.Count > 0)
            {
                Rv = (string)Dt.Rows[0][0];
            }

            return(Rv);
        }