Exemplo n.º 1
0
        protected override void DropDownFilter(Durados.Web.Mvc.ParentField parentField, ref string sql)
        {
            Durados.View view = parentField.ParentView;
            if ((new string[5] {
                "Issue", "Project", "User", "TimeSheet", "MonthlyProjectHoursReport"
            }).Contains(view.Name))
            {
                if (User.IsInRole("User"))
                {
                    if (User == null || User.Identity == null || User.Identity.Name == null)
                    {
                        throw new AccessViolationException();
                    }

                    int?companyID = Durados.Web.Mvc.Specifics.DataAccess.User.GetCompanyID(User.Identity.Name);

                    if (!companyID.HasValue)
                    {
                        throw new AccessViolationException();
                    }

                    sql += " where CompanyID = " + companyID.Value;
                }
            }
        }
Exemplo n.º 2
0
        protected override void DropDownFilter(Durados.Web.Mvc.ParentField parentField, ref string sql)
        {
            if (parentField.View.Name != "MemRequest_WaferSupply")
            {
                return;
            }

            if (parentField.ParentView.Name != "v_WaferSupply")
            {
                return;
            }

            int?memRequestID = GetMemRequestID();

            if (memRequestID.HasValue)
            {
                int?mdeID = GetMdeID(memRequestID.Value);

                if (mdeID.HasValue)
                {
                    string filter = GetWaferSupplyFilter(mdeID.Value, sql);

                    if (!string.IsNullOrEmpty(filter))
                    {
                        sql += filter;
                    }
                }
            }
        }
Exemplo n.º 3
0
 protected override void DropDownFilter(Durados.Web.Mvc.ParentField parentField, ref string sql)
 {
     Durados.View view = parentField.ParentView;
     if (view.Name == CRMViews.CountryType.ToString())
     {
         sql += " where Active = 1";
     }
 }
        protected override void DropDownFilter(Durados.Web.Mvc.ParentField parentField, ref string sql)
        {
            Durados.View view = parentField.ParentView;
            if (Durados.Web.Mvc.UI.Helpers.SecurityHelper.IsInRole("User") && view.Name == "User")
            {
                if (User == null || User.Identity == null || User.Identity.Name == null)
                {
                    throw new AccessViolationException();
                }

                sql += " where Username = N'" + User.Identity.Name + "'";
            }
        }
Exemplo n.º 5
0
        protected override void DropDownFilter(Durados.Web.Mvc.ParentField parentField, ref string sql)
        {
            Durados.View view = parentField.ParentView;
            if (User.IsInRole("User") && view.Name == "User")
            {
                if (User == null || User.Identity == null || User.Identity.Name == null)
                {
                    throw new AccessViolationException();
                }

                if (!sql.ToLower().Contains("where"))
                {
                    sql += " where Username = N'" + User.Identity.Name + "'";
                }
            }
        }
Exemplo n.º 6
0
        protected override void DropDownFilter(Durados.Web.Mvc.ParentField parentField, ref string sql)
        {
            base.DropDownFilter(parentField, ref sql);

            Durados.View view = parentField.ParentView;
            if (view.Name == "Issue")
            {
                if (sql.ToLower().Contains("where"))
                {
                    sql += " and [Issue].[TimeEstimate] > 0";
                }
                else
                {
                    sql += "where [Issue].[TimeEstimate] > 0";
                }
            }
        }
Exemplo n.º 7
0
        protected override void DropDownFilter(Durados.Web.Mvc.ParentField parentField, ref string sql)
        {
            Durados.View view = parentField.ParentView;
            if ((new string[1] {
                "A_111"
            }).Contains(view.Name))
            {
                if (User.IsInRole("User"))
                {
                    if (User == null || User.Identity == null || User.Identity.Name == null)
                    {
                        throw new AccessViolationException();
                    }

                    sql += " where sochen_1 = N'" + User.Identity.Name + "'";
                }
            }
        }
Exemplo n.º 8
0
        protected override void DropDownFilter(Durados.Web.Mvc.ParentField parentField, ref string sql)
        {
            Durados.View view = parentField.ParentView;
            if ((new string[6] {
                "Issue", "Project", "User", "TimeSheet", "MonthlyProjectHoursReport", "Company"
            }).Contains(view.Name))
            {
                if (Durados.Web.Mvc.UI.Helpers.SecurityHelper.IsInRole("User"))
                {
                    if (User == null || User.Identity == null || User.Identity.Name == null)
                    {
                        throw new AccessViolationException();
                    }

                    int?companyID = DataAccess.User.GetCompanyID(User.Identity.Name);

                    if (!companyID.HasValue)
                    {
                        throw new AccessViolationException();
                    }

                    if (view.Name == "Company")
                    {
                        sql += " where ID = " + companyID.Value;
                    }
                    else if (sql.IndexOf("CompanyID") < 0)
                    {
                        if (sql.ToLower().Contains("where"))
                        {
                            sql += " and CompanyID = " + companyID.Value;
                        }
                        else
                        {
                            sql += " where CompanyID = " + companyID.Value;
                        }
                    }
                }
            }
        }