예제 #1
0
        public override DTO.ModelMng.EditFormData GetData(int id, int iRequesterID, out Library.DTO.Notification notification)
        {
            // query data
            DTO.ModelMng.EditFormData        result    = factory.GetData(iRequesterID, id, out notification);
            Module.Framework.DAL.DataFactory fwFactory = new Module.Framework.DAL.DataFactory();
            if (fwFactory.CheckModelPricePermission(iRequesterID) <= 0)
            {
                // clear pricing data if not allow
                result.Data.ModelFixPriceConfigurations.Clear();
                result.Data.ModelPriceConfigurations.Clear();
                result.ModelPriceConfigurationDefault.Clear();
                result.IsPriceEnabled = false;
            }
            else
            {
                result.IsPriceEnabled = true;
            }

            if (fwFactory.CanPerformAction(iRequesterID, "ModelMng", Library.DTO.ModuleAction.CanApprove))
            {
                result.CanApprove = true;
            }
            else
            {
                result.CanApprove = false;
            }
            return(result);
        }
예제 #2
0
        public object GetDataCreateModel(int userId, int id, int sampleProductID, out Notification notification)
        {
            DTO.ModelMng.CreateModelEditData result = factory.GetDataCreateModel(userId, id, sampleProductID, out notification);

            Module.Framework.DAL.DataFactory fwFactory = new Module.Framework.DAL.DataFactory();

            if (fwFactory.CheckModelPricePermission(userId) <= 0)
            {
                // clear pricing data if not allow
                result.Data.ModelFixPriceConfigurations.Clear();
                result.Data.ModelPriceConfigurations.Clear();
                result.ModelPriceConfigurationDefault.Clear();
                result.IsPriceEnabled = false;
            }
            else
            {
                result.IsPriceEnabled = true;
            }

            if (fwFactory.CanPerformAction(userId, "ModelMng", Library.DTO.ModuleAction.CanApprove))
            {
                result.CanApprove = true;
            }
            else
            {
                result.CanApprove = false;
            }

            return(result);
        }
예제 #3
0
 public bool CanPerformAction(int userId, string moduleCode, Library.DTO.ModuleAction action)
 {
     return(factory.CanPerformAction(userId, moduleCode, action));
 }