示例#1
0
        /// <summary>
        /// Update data
        /// </summary>
        /// <param name="param">Entity</param>
        /// <param name="ignoreDeleteFlag">IgnoreDeleteFlag</param>
        public void Update(MParameter param, bool ignoreDeleteFlag)
        {
            // Get entity
            var entity = GetSingle(param.ParamCd, ignoreDeleteFlag);

            // Set value
            entity.ParamValue = param.ParamValue;
            entity.UpdateUser = PageHelper.UserName;
            entity.UpdateDate = DateTime.Now;
        }
示例#2
0
        /// <summary>
        /// Update data
        /// </summary>
        /// <param name="param">Entity</param>
        /// <param name="ignoreDeleteFlag">IgnoreDeleteFlag</param>
        public void Update(MParameter entity, bool ignoreDeleteFlag)
        {
            // Check param
            if (DataCheckHelper.IsNull(entity.ParamCd))
            {
                throw new ParamInvalidException();
            }

            //Update value
            _comDao.Update(entity, ignoreDeleteFlag);
        }
示例#3
0
        private void SendEmail(string Password, string User)
        {
            MParameter        parameterBE  = new MParameter();
            List <MParameter> parameterBEs = new List <MParameter>();

            int Val = 0;

            parameterBE.Code = "MAIL_PASSUSER";
            parameterBEs     = BParameter.List(parameterBE, ref Val);

            _MAwsEmail.Subject = "UNITLIFE - User generation";
            _MAwsEmail.Message = parameterBEs[0].Valor1.Replace("[Password]", UEncrypt.Decrypt(Password));
            _MAwsEmail.ToEmail = User;

            BAwsSDK.SendEmailAsync(_MAwsEmail);
        }
示例#4
0
        private void SendSESValidate(string Email)
        {
            int               val          = 0;
            MParameter        parameterBE  = new MParameter();
            List <MParameter> parameterBEs = new List <MParameter>();

            parameterBE.Code = "MAIL_VALIDATE";
            parameterBEs     = BParameter.List(parameterBE, ref val);

            if (val.Equals(0))
            {
                _MAwsEmail.Subject = "UNITLIFE - Registration";
                _MAwsEmail.Message = parameterBEs[0].Valor1;
                _MAwsEmail.ToEmail = Email;

                BAwsSDK.SendEmailAsync(_MAwsEmail);
            }
        }
示例#5
0
        private void SendSES(string Password, string Email)
        {
            int               val          = 0;
            MParameter        parameterBE  = new MParameter();
            List <MParameter> parameterBEs = new List <MParameter>();

            parameterBE.Code = "MAIL_PASS";
            parameterBEs     = BParameter.List(parameterBE, ref val);

            if (val.Equals(0))
            {
                _MAwsEmail.Subject = "UNITLIFE - User generation";
                _MAwsEmail.Message = parameterBEs[0].Valor1.Replace("[Password]", UEncrypt.Decrypt(Password));
                _MAwsEmail.ToEmail = Email;

                BAwsSDK.SendEmailAsync(_MAwsEmail);
            }
        }
示例#6
0
        public static List <MParameter> List(MParameter ent, ref int Val)
        {
            List <MParameter> lisQuery = new List <MParameter>();

            using (SqlConnection con = new SqlConnection(ConnectionDB.GetConnectionString()))
            {
                try
                {
                    SqlCommand cmd = new SqlCommand("sp_Parameters_List", con);
                    cmd.Parameters.Add("@ICode", SqlDbType.VarChar).Value        = ent.Code;
                    cmd.Parameters.Add("@IDescription", SqlDbType.VarChar).Value = ent.Description;
                    cmd.CommandTimeout = 0;
                    cmd.CommandType    = CommandType.StoredProcedure;
                    con.Open();

                    Val = 1;

                    using (var reader = cmd.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            MParameter entRow = new MParameter();
                            entRow.ParameterId = Convert.ToInt32(reader["ParameterId"]);
                            entRow.Code        = Convert.ToString(reader["Code"]);
                            entRow.Description = Convert.ToString(reader["Description"]);
                            entRow.Valor1      = Convert.ToString(reader["Valor1"]);
                            entRow.Valor2      = Convert.ToString(reader["Valor2"]);
                            lisQuery.Add(entRow);

                            Val = 0;
                        }
                    }
                    con.Close();
                }

                catch (Exception)
                {
                    Val = 2;
                }
            }

            return(lisQuery);
        }
示例#7
0
    private void OnGUI()
    {
        this.UpdateAvailableParameters();

        EditorGUILayout.LabelField("Parameter Name");
        selectedParameterNameIndex = EditorGUILayout.Popup(selectedParameterNameIndex, this.availableParameters);

        MParameter selected = SelectedParameter;

        //Update the available parameters

        if (selected != null)
        {
            this.customParameterName = selected.Name;

            //Custom parameter
            if (selected.Type == "Custom")
            {
                parameterName = EditorGUILayout.TextField("Name", parameterName);
                value         = EditorGUILayout.TextField("Value", value);

                this.selectedValueType = ValueType.String;
            }

            //Parameter as specified by the description
            else
            {
                //Visualize the parameter type
                EditorGUILayout.LabelField("Parameter Type: " + selected.Type);
                EditorGUILayout.LabelField("Required: " + selected.Type);
                EditorGUILayout.LabelField("Description: " + selected.Description);



                //Check the type and suggest an input field according to the type
                if (selected.Type.Contains("{") && selected.Type.Contains("}"))
                {
                    this.values             = selected.Type.Replace("{", "").Replace("}", "").Split(',');
                    this.selectedValueIndex = EditorGUILayout.Popup(selectedValueIndex, this.values);

                    this.selectedValueType = ValueType.Set;
                }

                //Provide the possibility to select a scene object
                else if (selected.Type == "ID")
                {
                    //Allow to select id of scene object
                    if (this.sceneObjectNames == null)
                    {
                        this.sceneObjectNames = UnitySceneAccess.Instance.GetSceneObjects().Select(s => s.Name).ToArray();
                        this.sceneObjectIDs   = UnitySceneAccess.Instance.GetSceneObjects().Select(s => s.ID).ToArray();
                    }

                    this.selectedSceneObjectIndex = EditorGUILayout.Popup(this.selectedSceneObjectIndex, this.sceneObjectNames);

                    this.selectedValueType = ValueType.ID;
                }


                //Handle boolean parameters
                else if (selected.Type == "Bool" || selected.Type == "Boolean" || selected.Type == "bool")
                {
                    this.boolValue = EditorGUILayout.Toggle("Value: ", this.boolValue);

                    this.selectedValueType = ValueType.Bool;
                }

                //Default free text field
                else
                {
                    this.isID = EditorGUILayout.Toggle("Treat as ID: ", this.isID);

                    if (isID)
                    {
                        //Allow to select id of scene object
                        if (this.sceneObjectNames == null)
                        {
                            this.sceneObjectNames = UnitySceneAccess.Instance.GetSceneObjects().Select(s => s.Name).ToArray();
                            this.sceneObjectIDs   = UnitySceneAccess.Instance.GetSceneObjects().Select(s => s.ID).ToArray();
                        }

                        this.selectedSceneObjectIndex = EditorGUILayout.Popup(this.selectedSceneObjectIndex, this.sceneObjectNames);

                        this.selectedValueType = ValueType.ID;
                    }
                    else
                    {
                        this.customParameterName = EditorGUILayout.TextField("Parameter Name", customParameterName);

                        this.value             = EditorGUILayout.TextField("Value", value);
                        this.selectedValueType = ValueType.String;
                    }
                }
            }
        }

        if (GUILayout.Button("Ok"))
        {
            switch (this.selectedValueType)
            {
            case ValueType.ID:
                this.AddParameter(this.availableParameters[this.selectedParameterNameIndex], this.sceneObjectIDs[this.selectedSceneObjectIndex]);
                break;

            case ValueType.Set:
                this.AddParameter(this.availableParameters[this.selectedParameterNameIndex], this.values[this.selectedValueIndex]);

                break;

            case ValueType.String:
                this.AddParameter(this.parameterName, this.value);

                break;

            case ValueType.Bool:
                this.AddParameter(this.availableParameters[this.selectedParameterNameIndex], this.boolValue.ToString());

                break;
            }
            Close();
        }


        if (GUILayout.Button("Abort"))
        {
            Close();
        }
    }
示例#8
0
        protected override bool AuthorizeCore(HttpContextBase httpContext)
        {
            MParameter lParam  = new MParameter();
            var        lResult = false;

            if (lParameterStr.Equals("IsCustomer"))
            {
                lResult = lParam.LIsModuleCustomer;
            }
            ;
            if (lParameterStr.Equals("IsInvoice"))
            {
                lResult = lParam.LIsModuleInvoice;
            }
            ;
            if (lParameterStr.Equals("IsProduct"))
            {
                lResult = lParam.LIsModuleProduct;
            }
            ;
            if (lParameterStr.Equals("IsRealizeOrder"))
            {
                lResult = lParam.LIsModuleRealizeOrder;
            }
            ;
            if (lParameterStr.Equals("IsDashBoard"))
            {
                lResult = lParam.LIsModuleDashBoard;
            }
            ;
            if (lParameterStr.Equals("IsInventory"))
            {
                lResult = lParam.LIsModuleInventory;
            }
            ;
            if (lParameterStr.Equals("IsSupplier"))
            {
                lResult = lParam.LIsModuleSupplier;
            }
            ;
            if (lParameterStr.Equals("CreateCustomer"))
            {
                lResult = lParam.LCreateCustomer;
            }
            ;
            if (lParameterStr.Equals("EditCustomer"))
            {
                lResult = lParam.LEditCustomer;
            }
            ;
            if (lParameterStr.Equals("DeleteCustomer"))
            {
                lResult = lParam.LDeleteCustomer;
            }
            ;
            if (lParameterStr.Equals("CreateSupplier"))
            {
                lResult = lParam.LCreateSupplier;
            }
            ;
            if (lParameterStr.Equals("EditSupplier"))
            {
                lResult = lParam.LEditSupplier;
            }
            ;
            if (lParameterStr.Equals("DeleteSupplier"))
            {
                lResult = lParam.LDeleteSupplier;
            }
            ;
            if (lParameterStr.Equals("CreateDashBoard"))
            {
                lResult = lParam.LCreateDashBoard;
            }
            ;
            if (lParameterStr.Equals("EditDashBoard"))
            {
                lResult = lParam.LEditDashBoard;
            }
            ;
            if (lParameterStr.Equals("DeleteDashBoard"))
            {
                lResult = lParam.LDeleteDashBoard;
            }
            ;
            if (lParameterStr.Equals("CreateInventory"))
            {
                lResult = lParam.LCreateInventory;
            }
            ;
            if (lParameterStr.Equals("EditInventory"))
            {
                lResult = lParam.LEditInventory;
            }
            ;
            if (lParameterStr.Equals("DeleteInventory"))
            {
                lResult = lParam.LDeleteInventory;
            }
            ;
            if (lParameterStr.Equals("CreateProduct"))
            {
                lResult = lParam.LCreateProduct;
            }
            ;
            if (lParameterStr.Equals("EditProduct"))
            {
                lResult = lParam.LEditProduct;
            }
            ;
            if (lParameterStr.Equals("DeleteProduct"))
            {
                lResult = lParam.LDeleteProduct;
            }
            ;
            return(lResult);
        }
示例#9
0
 public static List <MParameter> List(MParameter ent, ref int Val)
 {
     return(DAParameter.List(ent, ref Val));
 }
示例#10
0
        public static bool ToCompareconfiguration(this string pConfigurationApp)
        {
            var lParam  = new MParameter();
            var lResult = false;

            if (pConfigurationApp.Equals("IsCustomer"))
            {
                lResult = lParam.LIsModuleCustomer;
            }
            if (pConfigurationApp.Equals("IsInvoice"))
            {
                lResult = lParam.LIsModuleInvoice;
            }
            if (pConfigurationApp.Equals("IsProduct"))
            {
                lResult = lParam.LIsModuleProduct;
            }
            if (pConfigurationApp.Equals("IsRealizeOrder"))
            {
                lResult = lParam.LIsModuleRealizeOrder;
            }
            if (pConfigurationApp.Equals("IsDashBoard"))
            {
                lResult = lParam.LIsModuleDashBoard;
            }
            if (pConfigurationApp.Equals("IsInventory"))
            {
                lResult = lParam.LIsModuleInventory;
            }
            if (pConfigurationApp.Equals("IsSupplier"))
            {
                lResult = lParam.LIsModuleSupplier;
            }
            if (pConfigurationApp.Equals("IsOrder"))
            {
                lResult = lParam.LIsModuleOrder;
            }
            if (pConfigurationApp.Equals("CreateCustomer"))
            {
                lResult = lParam.LCreateCustomer;
            }
            if (pConfigurationApp.Equals("EditCustomer"))
            {
                lResult = lParam.LEditCustomer;
            }
            if (pConfigurationApp.Equals("DeleteCustomer"))
            {
                lResult = lParam.LDeleteCustomer;
            }
            if (pConfigurationApp.Equals("CreateSupplier"))
            {
                lResult = lParam.LCreateSupplier;
            }
            if (pConfigurationApp.Equals("EditSupplier"))
            {
                lResult = lParam.LEditSupplier;
            }
            if (pConfigurationApp.Equals("DeleteSupplier"))
            {
                lResult = lParam.LDeleteSupplier;
            }
            if (pConfigurationApp.Equals("CreateDashBoard"))
            {
                lResult = lParam.LCreateDashBoard;
            }
            if (pConfigurationApp.Equals("EditDashBoard"))
            {
                lResult = lParam.LEditDashBoard;
            }
            if (pConfigurationApp.Equals("DeleteDashBoard"))
            {
                lResult = lParam.LDeleteDashBoard;
            }
            if (pConfigurationApp.Equals("CreateInventory"))
            {
                lResult = lParam.LCreateInventory;
            }
            if (pConfigurationApp.Equals("EditInventory"))
            {
                lResult = lParam.LEditInventory;
            }
            if (pConfigurationApp.Equals("DeleteInventory"))
            {
                lResult = lParam.LDeleteInventory;
            }
            if (pConfigurationApp.Equals("CreateProduct"))
            {
                lResult = lParam.LCreateProduct;
            }
            if (pConfigurationApp.Equals("EditProduct"))
            {
                lResult = lParam.LEditProduct;
            }
            if (pConfigurationApp.Equals("DeleteProduct"))
            {
                lResult = lParam.LDeleteProduct;
            }
            return(lResult);
        }