Ejemplo n.º 1
0
        public CommonMDI(GlobalEnum.TaskID taskID)
        {
            InitializeComponent();

            this.taskID = taskID;

            if (this.taskID == GlobalEnum.TaskID.DataMessage)
            {
                this.Size = new Size(1250, 810);
            }
        }
Ejemplo n.º 2
0
        private void labelOpenCommonMDI_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                GlobalEnum.TaskID taskID = sender.Equals(this.pictureBoxLogo) ? GlobalEnum.TaskID.ListLogo : sender.Equals(this.pictureBoxFactory) ? GlobalEnum.TaskID.ListFactory : sender.Equals(this.pictureBoxOwner) ? GlobalEnum.TaskID.ListOwner : sender.Equals(this.pictureBoxCategory) ? GlobalEnum.TaskID.ListCategory : sender.Equals(this.pictureBoxProduct) ? GlobalEnum.TaskID.ListProduct : sender.Equals(this.pictureBoxCoil) ? GlobalEnum.TaskID.ListCoil : GlobalEnum.TaskID.ListCoil;

                CommonMDI commonMDI = new CommonMDI(taskID);
                if (commonMDI.ShowDialog() == System.Windows.Forms.DialogResult.OK || true)
                {
                    CommonMetaList commonMetaList = new CommonMetaList();
                    switch (taskID)
                    {
                    case GlobalEnum.TaskID.ListLogo:
                        this.comboBoxLogoID.DataSource = commonMetaList.GetListLogo();
                        break;

                    case GlobalEnum.TaskID.ListFactory:
                        this.comboBoxFactoryID.DataSource = commonMetaList.GetListFactory();
                        break;

                    case GlobalEnum.TaskID.ListOwner:
                        this.comboBoxOwnerID.DataSource = commonMetaList.GetListOwner();
                        break;

                    case GlobalEnum.TaskID.ListCategory:
                        this.comboBoxCategoryID.DataSource = commonMetaList.GetListCategory();
                        break;

                    case GlobalEnum.TaskID.ListProduct:
                        this.comboBoxProductID.DataSource = commonMetaList.GetListProduct();
                        break;

                    case GlobalEnum.TaskID.ListCoil:
                        this.comboBoxCoilID.DataSource = commonMetaList.GetListCoil();
                        break;

                    default:
                        break;
                    }
                }
                commonMDI.Dispose();
            }
            catch (Exception exception)
            {
                GlobalExceptionHandler.ShowExceptionMessageBox(this, exception);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Get the permission for a specific UserID on a specific TaskID ON A SPECIFIC UserOrganizationID
        /// </summary>
        /// <param name="userID"></param>
        /// <param name="taskID"></param>
        /// <param name="userOrganizationID"></param>
        /// <returns></returns>
        public static bool GetUserEditable(int userID, GlobalEnum.TaskID taskID, int userOrganizationID)
        {
            //Need to check the lasted version
            //Set lRec = ADORECNEW(): Call lRec.Open("SELECT MAX(VersionID) AS VersionID FROM VersionMaster ", ClassConn)
            //If Not lRec.BOF And Not lRec.EOF Then
            //    If lNMVNVersionID <> lRec.Fields("VersionID") Then
            //        MsgBox "The program ERmgr on this computer is not the lasted version." & Chr(13) & "Please contact your admin for more information. Thank you!", vbExclamation + vbDefaultButton1, "ERmgr"
            //        End
            //    End If
            //End If

            SqlParameter[] sqlParameter = new SqlParameter[3];
            sqlParameter[0] = new SqlParameter("UserID", userID); sqlParameter[0].SqlDbType = SqlDbType.Int; sqlParameter[0].Direction = ParameterDirection.Input;
            sqlParameter[1] = new SqlParameter("TaskID", (int)taskID); sqlParameter[1].SqlDbType = SqlDbType.Int; sqlParameter[1].Direction = ParameterDirection.Input;
            sqlParameter[2] = new SqlParameter("UserOrganizationID", userOrganizationID); sqlParameter[0].SqlDbType = SqlDbType.Int; sqlParameter[0].Direction = ParameterDirection.Input;

            int aclEditable = SQLDatabase.GetScalarValue("SPUserACLEditable", CommandType.StoredProcedure, sqlParameter);

            return((ACLLevel)aclEditable == ACLLevel.ACLEditable);
        }