예제 #1
0
        protected void lstAccessCategory_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                DataRowView dr = (DataRowView)e.Item.DataItem;

                Label lblCategory = (Label)e.Item.FindControl("lblCategory");
                lblCategory.Text = dr["Category"].ToString();

                DataList lstItem = (DataList)e.Item.FindControl("lstItem");
                if (cboGroup.ToolTip == "1") //check if load from cboGroup_SelectedIndexChanged
                {
                    AccessGroupRights clsAccessGroupRights = new AccessGroupRights();
                    lstItem.DataSource = clsAccessGroupRights.DataList(lblCategory.Text, int.Parse(cboGroup.SelectedValue), "Category, SequenceNo", SortOption.Ascending).DefaultView;
                    clsAccessGroupRights.CommitAndDispose();
                }
                else
                {
                    AccessRights clsAccessRights = new AccessRights();
                    lstItem.DataSource = clsAccessRights.DataList(lblCategory.Text, long.Parse(lblUID.Text), "Category, SequenceNo", SortOption.Ascending).DefaultView;
                    clsAccessRights.CommitAndDispose();
                }
                lstItem.DataBind();
            }
        }
예제 #2
0
		private void ManageSecurity()
		{
			Int64 UID = Convert.ToInt64(Session["UID"]);
			AccessRights clsAccessRights = new AccessRights(); 
			AccessRightsDetails clsDetails = new AccessRightsDetails();

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.Contacts); 
			lnkCustomers.Visible = clsDetails.Read; 

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.SalesOrders); 
			lnkSalesOrders.Visible = clsDetails.Read;
            lnkPostedSalesOrders.Visible = clsDetails.Read;
            lnkSalesAnalysis.Visible = clsDetails.Read;

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.SalesJournals); 
			lnkSalesJournals.Visible = clsDetails.Read; 

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.SalesReturns); 
			lnkSalesReturns.Visible = clsDetails.Read;
            lnkPostedSOReturns.Visible = clsDetails.Read;

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.SalesCreditMemos); 
			lnkCreditMemos.Visible = clsDetails.Read;
            lnkPostedCreditMemo.Visible = clsDetails.Read; 	

			clsAccessRights.CommitAndDispose();
		}
예제 #3
0
		private void ManageSecurity()
		{
            Security.AccessUserDetails clsAccessUserDetails = (Security.AccessUserDetails)Session["AccessUserDetails"];
			AccessRights clsAccessRights = new AccessRights(); 
			AccessRightsDetails clsDetails = new AccessRightsDetails();

            clsDetails = clsAccessRights.Details(clsAccessUserDetails.UID, (Int16)AccessTypes.Products); 
			lnkProducts.Visible = clsDetails.Read; 
			lnkProductAdd.Visible = clsDetails.Write;

            clsDetails = clsAccessRights.Details(clsAccessUserDetails.UID, (int)AccessTypes.SynchronizeBranchProducts);
            lnkSynchronize.Visible = clsDetails.Read;

            clsDetails = clsAccessRights.Details(clsAccessUserDetails.UID, (Int16)AccessTypes.Contacts); 
			lnkContact.Visible = clsDetails.Read;
            lnkRewards.Visible = clsDetails.Read;

            clsDetails = clsAccessRights.Details(clsAccessUserDetails.UID, (Int16)AccessTypes.InventoryList); 
			lnkInventoryList.Visible = clsDetails.Read;

            clsDetails = clsAccessRights.Details(clsAccessUserDetails.UID, (Int16)AccessTypes.StockTransactions); 
			lnkStock.Visible = clsDetails.Read; 
			lnkUpload.Visible = clsDetails.Read;

            clsDetails = clsAccessRights.Details(clsAccessUserDetails.UID, (Int16)AccessTypes.AccessUsers); 
			lnkAccessUserAdd.Visible = clsDetails.Write;

            clsDetails = clsAccessRights.Details(clsAccessUserDetails.UID, (Int16)AccessTypes.ReportFormat); 
			lnkReceiptFormatEdit.Visible = clsDetails.Write; 

			clsAccessRights.CommitAndDispose();
		}
예제 #4
0
		private void ManageSecurity()
		{
			Int64 UID = Convert.ToInt64(Session["UID"]);
			AccessRights clsAccessRights = new AccessRights(); 
			AccessRightsDetails clsDetails = new AccessRightsDetails();

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.InventoryMenu); 
			if (clsDetails.Read==false)
				Server.Transfer("/RetailPlus/Home/Default.aspx");
			clsAccessRights.CommitAndDispose();
		}
예제 #5
0
		private void ManageSecurity()
		{
			Int64 UID = Convert.ToInt64(Session["UID"]);
			AccessRights clsAccessRights = new AccessRights(); 
			AccessRightsDetails clsDetails = new AccessRightsDetails();

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.GeneralLedgerMenu); 
			if (clsDetails.Read==false)
				Server.Transfer(Constants.ROOT_DIRECTORY + "/Home/Default.aspx");
			clsAccessRights.CommitAndDispose();
		}
예제 #6
0
		private void ManageSecurity()
		{
			Int64 UID = Convert.ToInt64(Session["UID"]);
			AccessRights clsAccessRights = new AccessRights(); 
			AccessRightsDetails clsDetails = new AccessRightsDetails();

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.BankDeposits);
            lnkBankDeposits.Visible = clsDetails.Read;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.WriteCheques);
            lnkWriteCheque.Visible = clsDetails.Read;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.FundTransfers);
            lnkFundTransfers.Visible = clsDetails.Read;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.ReconcileAccounts);
            lnkReconcileAccounts.Visible = clsDetails.Read; 

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.AccountSummary); 
			lnkAccountSummaries.Visible = clsDetails.Read; 

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.AccountCategory); 
			lnkAccountCategory.Visible = clsDetails.Read; 

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.ChartOfAccounts); 
			lnkChartOfAccounts.Visible = clsDetails.Read;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.PaymentJournals);
            lnkGeneralJournals.Visible = clsDetails.Read; 

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.PaymentJournals); 
			lnkPaymentJournals.Visible = clsDetails.Read; 

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.PostingDates); 
			lnkPostingDates.Visible = clsDetails.Read;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.Banks);
            lnkBankAccounts.Visible = clsDetails.Read;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.APLinkConfig);
            lnkLinkAccountsProduct.Visible = clsDetails.Read;
            lnkLinkAccountsAP.Visible = clsDetails.Read;

            //lnkBalanceSheetReport.Visible = false;
            //lnkChartOfAccountsReport.Visible = true;
            //lnkGeneralLedgerReport.Visible = false;
            lnkGeneralJournalsReport.Visible = false;
            lnkPaymentJournalReport.Visible = false;
            lnkProfitAndLossReport.Visible = false;
            lnkTrialBalanceReport.Visible = false;

			clsAccessRights.CommitAndDispose();
		}
예제 #7
0
		private void ManageSecurity()
		{
			Int64 UID = Convert.ToInt64(Session["UID"]);
			AccessRights clsAccessRights = new AccessRights(); 
			AccessRightsDetails clsDetails = new AccessRightsDetails();

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.RewardPointsSetup); 
			lnkMembers.Visible = clsDetails.Read;
            lnkRewardsMovement.Visible = clsDetails.Read;
            lnkCheckRewardPoints.Visible = clsDetails.Read;
            lnkRewardsSummary.Visible = clsDetails.Read;
            lnkRewardsSummaryStatistics.Visible = clsDetails.Read;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.RewardPointsReedemption); 
            lnkRewardsReddem.Visible = clsDetails.Read;

            clsAccessRights.CommitAndDispose();
		}
예제 #8
0
		private void ManageSecurity()
		{
			Int64 UID = Convert.ToInt64(Session["UID"]);
			AccessRights clsAccessRights = new AccessRights(); 
			AccessRightsDetails clsDetails = new AccessRightsDetails();

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.ProductVariations); 
			imgAdd.Visible = clsDetails.Write; 
			cmdAdd.Visible = clsDetails.Write; 
			imgDelete.Visible = clsDetails.Write; 
			cmdDelete.Visible = clsDetails.Write; 
			cmdEdit.Visible = clsDetails.Write; 
			idEdit.Visible = clsDetails.Write; 
			lblSeparator1.Visible = clsDetails.Write;
			lblSeparator2.Visible = clsDetails.Write;

			clsAccessRights.CommitAndDispose();
		}
예제 #9
0
		private void ManageSecurity()
		{
			Int64 UID = Convert.ToInt64(Session["UID"]);
			AccessRights clsAccessRights = new AccessRights(); 
			AccessRightsDetails clsDetails = new AccessRightsDetails();

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.InternalCreditCardSetup);
            lnkCardTypes.Visible = clsDetails.Read;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.CreditorsWithoutGuarantor);
            lnkCreditorsWithoutGuarantors.Visible = clsDetails.Read;
            lnkChangeCreditType.Visible = clsDetails.Read;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.CreditorsWithoutGuarantorPurchases);
            lnkCreditorsWithoutGurantorPurchases.Visible = clsDetails.Read;
            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.CreditorsWithoutGuarantorPayments);
            lnkCreditorsWithoutGuarantorPayments.Visible = clsDetails.Read;
            lnkSummarizedStatistics.Visible = clsDetails.Read;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.CreditorsLedgerSummary);
            lnkGuarantorsLedger.Visible = clsDetails.Read;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.CreditorsWithGuarantor);
            lnkCreditorsWithGuarantors.Visible = clsDetails.Read;
            lnkChangeCreditTypeWG.Visible = clsDetails.Read;
            lnkChangeCreditType.Visible = clsDetails.Read;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.CreditorsWithGuarantorPurchases);
            lnkCreditorsWithGurantorPurchases.Visible = clsDetails.Read;
            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.CreditorsWithGuarantorPayments);
            lnkCreditorsWithGuarantorPayments.Visible = clsDetails.Read;
            lnkSummarizedStatisticsWG.Visible = clsDetails.Read;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.GuarantorsLedgerSummary);
            lnkGuarantorsLedger.Visible = clsDetails.Read;

			clsAccessRights.CommitAndDispose();
		}
예제 #10
0
		private void ManageSecurity()
		{
			Int64 UID = Convert.ToInt64(Session["UID"]);
			AccessRights clsAccessRights = new AccessRights(); 
			AccessRightsDetails clsDetails = new AccessRightsDetails();

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.Home); 
			NavHome.Visible = clsDetails.Read; 

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.MasterFilesMenu); 
			NavMasterFiles.Visible = clsDetails.Read;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.RewardCardIssuance);
            NavRewards.Visible = clsDetails.Read; 

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.CreditCardIssuance);
            NavCredits.Visible = clsDetails.Read; 

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.GeneralLedgerMenu); 
			NavGeneralLedger.Visible = clsDetails.Read;

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.PurchasesAndPayablesMenu); 
			NavPurchasesAndPayables.Visible = clsDetails.Read;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.SalesAndReceivablesMenu); 
			NavSalesAndReceivables.Visible = clsDetails.Read;

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.InventoryMenu); 
			NavInventory.Visible = clsDetails.Read;			

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.ReportsMenu); 
			NavReports.Visible = clsDetails.Read; 

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.AdministrationFilesMenu); 
			NavAdministrationFiles.Visible = clsDetails.Read; 

			clsAccessRights.CommitAndDispose();
		}
예제 #11
0
        public DialogResult GetWriteAccess(Int64 UID, AccessTypes accesstype)
        {
            DialogResult resRetValue = DialogResult.None;

            AccessRights clsAccessRights = new AccessRights(mConnection, mTransaction);
            AccessRightsDetails clsDetails = new AccessRightsDetails();

            clsDetails = clsAccessRights.Details(UID, (Int16)accesstype);

            if (clsDetails.Write)
            {
                resRetValue = DialogResult.OK;
            }

            clsAccessRights.CommitAndDispose();

            return resRetValue;
        }
예제 #12
0
		private void ManageSecurity()
		{
			Int64 UID = Convert.ToInt64(Session["UID"]);
			AccessRights clsAccessRights = new AccessRights(); 
			AccessRightsDetails clsDetails = new AccessRightsDetails();

            bool boShowProductSetup = false;
            bool boShowContactSetup = false;
            bool boShowMiscSetup = false;
            bool boShowActionBar = false;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.Products);

            lnkProducts.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkProducts.Style.Add("display", "none");
            
            lnkProductsDetailed.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkProductsDetailed.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowProductSetup) boShowProductSetup = true;

            lnkAddvariationType.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkAddvariationType.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowActionBar) boShowActionBar = true;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.ProductGroups);
            lnkProductGroup.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkProductGroup.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowProductSetup) boShowProductSetup = true;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.ProductSubGroups);
            lnkProductSubGroup.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkProductSubGroup.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowProductSetup) boShowProductSetup = true;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.Promos);
            lnkPromo.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkPromo.Style.Add("display", "none");
            // show label for Misc
            if (clsDetails.Read && !boShowProductSetup) boShowProductSetup = true;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.PromosBySupplier);
            lnkPromoBySupplier.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkPromoBySupplier.Style.Add("display", "none");
            // show label for Misc
            if (clsDetails.Read && !boShowProductSetup) boShowProductSetup = true;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.Variations);
            lnkVariation.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkVariation.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowProductSetup) boShowProductSetup = true;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.UnitMeasurement);
            lnkUnit.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkUnit.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowProductSetup) boShowProductSetup = true;
			
            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.SynchronizeBranchProducts);
            lnkSynchronize.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkSynchronize.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Write && !boShowActionBar) boShowActionBar = true;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.RewardPointsSetup);
            lnkChangeRewardPoints.Visible = clsDetails.Write;
            if (!clsDetails.Write) divlnkChangeRewardPoints.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Write && !boShowActionBar) boShowActionBar = true;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.ChangeProductPrices);
            lnkChangeProductPrice.Visible = clsDetails.Write;
            if (!clsDetails.Write) divlnkChangeProductPrice.Style.Add("display", "none");

            lnkChangeTax.Visible = clsDetails.Write;
            if (!clsDetails.Write) divlnkChangeTax.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Write && !boShowActionBar) boShowActionBar = true;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.PrintShlevesTagPrice);
            lnkChangeOSPrinter.Visible = clsDetails.Write;
            if (!clsDetails.Write) divlnkChangeOSPrinter.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Write && !boShowActionBar) boShowActionBar = true;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.ChangePriceLevel);
            lnkChangePriceLevel.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkChangePriceLevel.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Write && !boShowActionBar) boShowActionBar = true;

            // Contacts
            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.ContactGroups);
            lnkContactGroup.Visible = clsDetails.Read;

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.Contacts); 
			lnkContact.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkContact.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Write && !boShowContactSetup) boShowContactSetup = true;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.CustomerManagement);
            lnkContactDetailed.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkContactDetailed.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Write && !boShowContactSetup) boShowContactSetup = true;

			clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.Position);
            lnkPositions.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkPositions.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Write && !boShowContactSetup) boShowContactSetup = true;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.Department);
            lnkDepartments.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkDepartments.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Write && !boShowContactSetup) boShowContactSetup = true;

            // Miscellaneous
			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.Discounts); 
			lnkDiscount.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkDiscount.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Write && !boShowMiscSetup) boShowMiscSetup = true;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.CardType);
            lnkChargeType.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkCardType.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Write && !boShowMiscSetup) boShowMiscSetup = true;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.ChargeType);
            lnkChargeType.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkChargeType.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Write && !boShowMiscSetup) boShowMiscSetup = true;
            
			clsAccessRights.CommitAndDispose();

            if (!boShowProductSetup)
            {
                divlblProductSetup.Style.Add("display", "none");
                divtblProductSetup.Style.Add("display", "none");
            }

            if (!boShowContactSetup)
            {
                divlblContactSetup.Style.Add("display", "none");
                divtblContactSetup.Style.Add("display", "none");
            }

            if (!boShowMiscSetup)
            {
                divlblMiscSetup.Style.Add("display", "none");
                divtblMiscSetup.Style.Add("display", "none");
            }

            if (!boShowActionBar)
            {
                divlblActionBar.Style.Add("display", "none");
            }
		}
예제 #13
0
		private void ManageSecurity()
		{
			Int64 UID = Convert.ToInt64(Session["UID"]);
			AccessRights clsAccessRights = new AccessRights(); 
			AccessRightsDetails clsDetails = new AccessRightsDetails();

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.Products); 
			imgAdd.Visible = clsDetails.Write; 
			cmdAdd.Visible = clsDetails.Write; 
			imgDelete.Visible = clsDetails.Write; 
			cmdDelete.Visible = clsDetails.Write; 
			cmdEdit.Visible = clsDetails.Write; 
			idEdit.Visible = clsDetails.Write; 
			lblSeparator1.Visible = clsDetails.Write;
			lblSeparator2.Visible = clsDetails.Write;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.ProductUnitMatrix); 
            lblUnitMatrixAccess.Text = Convert.ToInt16(clsDetails.Write).ToString();

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.ProductComposition); 
			cmdCompose.Visible = clsDetails.Write; 
			idCompose.Visible = clsDetails.Write; 
			lblSeparator3.Visible = clsDetails.Write;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.ItemSetupFinancial);
            cmdFinance.Visible = clsDetails.Write;
            idFinance.Visible = clsDetails.Write;
            lblSeparator4.Visible = clsDetails.Write;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.Variations);
            lblVariationsAccess.Text = Convert.ToInt16(clsDetails.Write).ToString();

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.ProductPackage);
            lblProductPackageAccess.Text = Convert.ToInt16(clsDetails.Write).ToString();

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.InvAdjustment);
            lblInvAdjustmentAccess.Text = Convert.ToInt16(clsDetails.Write).ToString();

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.ProductsListReport);
            lblProductsListReportAccess.Text = Convert.ToInt16(clsDetails.Write).ToString();

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.ProductsListReport);
            lblProductsListReportAccess.Text = Convert.ToInt16(clsDetails.Write).ToString();

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.PricesReport);
            lblPricesReportAccess.Text = Convert.ToInt16(clsDetails.Write).ToString();

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.ChangeProductPrices);
            lblChangePriceAccess.Text = Convert.ToInt16(clsDetails.Write).ToString();

			clsAccessRights.CommitAndDispose();
		}
예제 #14
0
		private void ManageSecurity()
		{
			Int64 UID = Convert.ToInt64(Session["UID"]);
			AccessRights clsAccessRights = new AccessRights(); 
			AccessRightsDetails clsDetails = new AccessRightsDetails();

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.StockTransactions); 
			imgAdd.Visible = clsDetails.Write; 
			cmdAdd.Visible = clsDetails.Write; 
			imgDelete.Visible = clsDetails.Write; 
			cmdDelete.Visible = clsDetails.Write; 
			cmdEdit.Visible = clsDetails.Write; 
			imgEdit.Visible = clsDetails.Write; 
			lblSeparator1.Visible = clsDetails.Write;
			lblSeparator2.Visible = clsDetails.Write;

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.BranchTransfer); 
			lblSeparator3.Visible = clsDetails.Read;
			cmdTransfer.Visible  = clsDetails.Read;

			clsAccessRights.CommitAndDispose();
		}
예제 #15
0
		private void ManageSecurity()
		{
			Int64 UID = Convert.ToInt64(Session["UID"]);
			AccessRights clsAccessRights = new AccessRights(); 
			AccessRightsDetails clsDetails = new AccessRightsDetails();

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.PaymentJournals); 
			imgAdd.Visible = clsDetails.Write; 
			cmdAdd.Visible = clsDetails.Write; 
			imgCancel.Visible = clsDetails.Write; 
			cmdCancel.Visible = clsDetails.Write; 
			imgEdit.Visible = clsDetails.Write; 
			cmdEdit.Visible = clsDetails.Write; 
			lblSeparator1.Visible = clsDetails.Write;
			lblSeparator2.Visible = clsDetails.Write;

			clsAccessRights.CommitAndDispose();
		}
예제 #16
0
        private long SaveRecord()
        {
            long id = Convert.ToInt64(lblUID.Text);

            AccessRights clsAccessRights = new AccessRights();
            AccessRightsDetails clsDetails;
            foreach (DataListItem itemAccessCategory in lstAccessCategory.Items)
            {
                DataList lstItem = (DataList)itemAccessCategory.FindControl("lstItem");
                foreach (DataListItem item in lstItem.Items)
                {
                    HtmlInputCheckBox chkList = (HtmlInputCheckBox)item.FindControl("chkList");
                    HtmlInputCheckBox chkRead = (HtmlInputCheckBox)item.FindControl("chkRead");
                    HtmlInputCheckBox chkWrite = (HtmlInputCheckBox)item.FindControl("chkWrite");

                    clsDetails = new AccessRightsDetails();
                    clsDetails.UID = id;
                    clsDetails.TranTypeID = Convert.ToInt16(chkList.Value);
                    clsDetails.Read = chkRead.Checked;
                    clsDetails.Write = chkWrite.Checked;

                    clsAccessRights.Modify(clsDetails);
                }
            }
            clsAccessRights.CommitAndDispose();

            return id;
        }
예제 #17
0
        private void ApplyToUsers()
        {
            Int32 intGroupID = Convert.ToInt32(lblGroupID.Text);

            AccessRightsDetails clsDetails;
            AccessUser clsAccessUser = new AccessUser();
            DataTable dt = clsAccessUser.ListAsDataTable(AccessGroupTypes.All, string.Empty, 0, intGroupID);

            AccessRights clsAccessRights = new AccessRights(clsAccessUser.Connection, clsAccessUser.Transaction);

            foreach (DataRow dr in dt.Rows)
            {
                long lngUID = long.Parse(dr["UID"].ToString());

                foreach (DataListItem itemAccessCategory in lstAccessCategory.Items)
                {
                    DataList lstItem = (DataList)itemAccessCategory.FindControl("lstItem");
                    foreach (DataListItem item in lstItem.Items)
                    {
                        HtmlInputCheckBox chkList = (HtmlInputCheckBox)item.FindControl("chkList");
                        HtmlInputCheckBox chkRead = (HtmlInputCheckBox)item.FindControl("chkRead");
                        HtmlInputCheckBox chkWrite = (HtmlInputCheckBox)item.FindControl("chkWrite");

                        clsDetails = new AccessRightsDetails();
                        clsDetails.UID = lngUID;
                        clsDetails.TranTypeID = Convert.ToInt16(chkList.Value);
                        clsDetails.Read = chkRead.Checked;
                        clsDetails.Write = chkWrite.Checked;

                        clsAccessRights.Modify(clsDetails);
                    }
                }
            }

            clsAccessUser.CommitAndDispose();
        }
예제 #18
0
		private void ManageSecurity()
		{
			Int64 UID = Convert.ToInt64(Session["UID"]);
			AccessRights clsAccessRights = new AccessRights(); 
			AccessRightsDetails clsDetails = new AccessRightsDetails();

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.Contacts);
			cmdEdit.Visible = clsDetails.Write; 
			idEdit.Visible = clsDetails.Write;
            cmdPrintBilling.Visible = clsDetails.Write;
            idPrintBilling.Visible = clsDetails.Write;
            lblSeparator2.Visible = clsDetails.Write;

			clsAccessRights.CommitAndDispose();
		}
예제 #19
0
        //protected void imgAddProduct_Click(object sender, System.Web.UI.ImageClickEventArgs e)
        //{
        //    string newWindowUrl = Constants.ROOT_DIRECTORY + "/MasterFiles/_Product/Default.aspx?task=" + Common.Encrypt("add", Session.SessionID) + "&windowaction=" + Common.Encrypt("close", Session.SessionID);
        //    string javaScript =
        //     "<script type='text/javascript'>\n" +
        //     "<!--\n" +
        //     "window.open('" + newWindowUrl + "');\n" +
        //     "// -->\n" +
        //     "</script>\n";
        //    this.Page.ClientScript.RegisterStartupScript(GetType(), "openwindow", javaScript);
        //}
		#endregion

		#region Private Methods

        private void ManageSecurity()
        {
            Int64 UID = Convert.ToInt64(Session["UID"]);
            AccessRights clsAccessRights = new AccessRights();
            AccessRightsDetails clsDetails = new AccessRightsDetails();

            WBranchTransferStatus clsWBranchTransferStatus = (WBranchTransferStatus)Enum.Parse(typeof(WBranchTransferStatus), lblStatus.Text);

            updSubmitForApproval.Visible = false;
            updIssueGRN.Visible = false;
            updIssueGRN1.Visible = false;
            updIssueGRN2.Visible = false;
            lblSeparator1.Visible = false;
            lblSeparator2.Visible = false;
            lblSeparator3.Visible = false;

            if (clsWBranchTransferStatus == WBranchTransferStatus.ForApproval)
            {
                clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.WarehouseToBranchTransferIssueGRN);
                lblSeparator1.Visible = clsDetails.Write;
                lblSeparator2.Visible = clsDetails.Write;
                updIssueGRN.Visible = clsDetails.Write;
                updIssueGRN1.Visible = clsDetails.Write;
                updIssueGRN2.Visible = clsDetails.Write;
            }
            else if (clsWBranchTransferStatus == WBranchTransferStatus.Open)
            {
                clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.WarehouseToBranchTransfer);
                updSubmitForApproval.Visible = clsDetails.Write;
            }
            clsAccessRights.CommitAndDispose();
        }
예제 #20
0
		private void ManageSecurity()
		{
			Int64 UID = Convert.ToInt64(Session["UID"]);
			AccessRights clsAccessRights = new AccessRights(); 
			AccessRightsDetails clsDetails = new AccessRightsDetails();

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.PurchasesAndPayablesMenu); 
			clsAccessRights.CommitAndDispose();

            if (!clsDetails.Read) Server.Transfer(Constants.ROOT_DIRECTORY + "/Home.aspx");
		}
예제 #21
0
        private void ManageSecurity()
        {
            Int64 UID = Convert.ToInt64(Session["UID"]);
            AccessRights clsAccessRights = new AccessRights();
            AccessRightsDetails clsDetails = new AccessRightsDetails();

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.PrintShlevesTagPrice);
            holderTagPrice.Visible = clsDetails.Write;

            clsAccessRights.CommitAndDispose();
        }
예제 #22
0
		private void ManageSecurity()
		{
			Int64 UID = Convert.ToInt64(Session["UID"]);
			AccessRights clsAccessRights = new AccessRights(); 
			AccessRightsDetails clsDetails = new AccessRightsDetails();

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.PurchaseOrderseSales); 
			imgAdd.Visible = clsDetails.Write; 
			cmdAdd.Visible = clsDetails.Write; 
			imgDelete.Visible = clsDetails.Write; 
			cmdDelete.Visible = clsDetails.Write; 
			cmdEdit.Visible = clsDetails.Write; 
			imgEdit.Visible = clsDetails.Write;
            imgGRN.Visible = clsDetails.Write;
            cmdGRN.Visible = clsDetails.Write;
			lblSeparator1.Visible = clsDetails.Write;
			lblSeparator2.Visible = clsDetails.Write;
//			lblSeparator3.Visible = clsDetails.Write;
			clsAccessRights.CommitAndDispose();
		}
예제 #23
0
		private void ManageSecurity()
		{
            Security.AccessUserDetails clsAccessUserDetails = (Security.AccessUserDetails)Session["AccessUserDetails"];
			AccessRights clsAccessRights = new AccessRights(); 
			AccessRightsDetails clsDetails = new AccessRightsDetails();

            bool boShowMyFavorites = false;
            bool boShowActionBar = false;

            clsDetails = clsAccessRights.Details(clsAccessUserDetails.UID, (Int16)AccessTypes.Products); 
			lnkProducts.Visible = clsDetails.Read;
            if (!clsDetails.Read) divlnkProducts.Style.Add("display", "none");

            lnkProductAdd.Visible = clsDetails.Write;
            if (!clsDetails.Write) divlnkProductAdd.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowMyFavorites) boShowMyFavorites = true;

            clsDetails = clsAccessRights.Details(clsAccessUserDetails.UID, (int)AccessTypes.SynchronizeBranchProducts);
            lnkSynchronize.Visible = clsDetails.Read;
            if (!clsDetails.Read) divlnkSynchronize.Style.Add("display", "none");

            // show label for reporting
            if (clsDetails.Read && !boShowActionBar) boShowActionBar = true;

            clsDetails = clsAccessRights.Details(clsAccessUserDetails.UID, (Int16)AccessTypes.Contacts); 
			lnkContact.Visible = clsDetails.Read;
            if (!clsDetails.Read) divlnkContact.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowMyFavorites) boShowMyFavorites = true;

            clsDetails = clsAccessRights.Details(clsAccessUserDetails.UID, (Int16)AccessTypes.RewardItemsSetup); 
            lnkRewards.Visible = clsDetails.Read;
            if (!clsDetails.Read) divlnkRewards.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowMyFavorites) boShowMyFavorites = true;

            clsDetails = clsAccessRights.Details(clsAccessUserDetails.UID, (Int16)AccessTypes.InventoryList); 
			lnkInventoryList.Visible = clsDetails.Read;
            if (!clsDetails.Read) divlnkInventoryList.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowMyFavorites) boShowMyFavorites = true;

            clsDetails = clsAccessRights.Details(clsAccessUserDetails.UID, (Int16)AccessTypes.StockTransactions); 
			lnkStock.Visible = clsDetails.Read;
            if (!clsDetails.Read) divlnkStock.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowMyFavorites) boShowMyFavorites = true;

            lnkUpload.Visible = clsDetails.Read;
            //if (!clsDetails.Read) divactlnkUpload.Style.Add("display", "none");
            if (!clsDetails.Read) divlnkUpload.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowActionBar) boShowActionBar = true;

            clsDetails = clsAccessRights.Details(clsAccessUserDetails.UID, (Int16)AccessTypes.AccessUsers); 
			lnkAccessUserAdd.Visible = clsDetails.Write;
            if (!clsDetails.Read) divlnkAccessUserAdd.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowActionBar) boShowActionBar = true;

            clsDetails = clsAccessRights.Details(clsAccessUserDetails.UID, (Int16)AccessTypes.ReportFormat); 
			lnkReceiptFormatEdit.Visible = clsDetails.Write;
            if (!clsDetails.Read) divlnkReceiptFormatEdit.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowActionBar) boShowActionBar = true;

            //divactlnkGLAUploadSales.Style.Add("display", "none");
            divlnkGLAUploadSales.Style.Add("display", "none");
            lnkGLAUploadSales.Visible = false;

			clsAccessRights.CommitAndDispose();

            if (!boShowMyFavorites)
            {
                divlblMyFavorites.Style.Add("display", "none");
                divtblMyFavorites.Style.Add("display", "none");
            }

            if (!boShowActionBar)
            {
                divlblActionBar.Style.Add("display", "none");
            }
		}
        private void ManageSecurity()
        {
            Int64 UID = Convert.ToInt64(Session["UID"]);
            AccessRights clsAccessRights = new AccessRights();
            AccessRightsDetails clsDetails = new AccessRightsDetails();

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.CloseInventory);
            imgZeroOutActualQuantity.Visible = clsDetails.Write;
            cmdZeroOutActualQuantity.Visible = clsDetails.Write;
            imgCloseInventory.Visible = clsDetails.Write;
            cmdCloseInventory.Visible = clsDetails.Write;
            lblSeparator1.Visible = clsDetails.Write;
            //lblSeparator2.Visible = clsDetails.Write;

            clsAccessRights.CommitAndDispose();
        }
예제 #25
0
		private void ManageSecurity()
		{
			Int64 UID = Convert.ToInt64(Session["UID"]);
			AccessRights clsAccessRights = new AccessRights(); 
			AccessRightsDetails clsDetails = new AccessRightsDetails();

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.Products); 
			imgAdd.Visible = clsDetails.Write; 
			cmdAdd.Visible = clsDetails.Write; 
			imgDelete.Visible = clsDetails.Write; 
			cmdDelete.Visible = clsDetails.Write; 
			cmdEdit.Visible = clsDetails.Write; 
			idEdit.Visible = clsDetails.Write; 
			lblSeparator1.Visible = clsDetails.Write;
			lblSeparator2.Visible = clsDetails.Write;

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.ProductComposition); 
			cmdCompose.Visible = clsDetails.Write; 
			idCompose.Visible = clsDetails.Write; 
			lblSeparator3.Visible = clsDetails.Write;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.ItemSetupFinancial);
            cmdFinance.Visible = clsDetails.Write;
            idFinance.Visible = clsDetails.Write;
            lblSeparator4.Visible = clsDetails.Write;

			clsAccessRights.CommitAndDispose();
		}
예제 #26
0
		private void ManageSecurity()
		{
			Int64 UID = Convert.ToInt64(Session["UID"]);
			AccessRights clsAccessRights = new AccessRights(); 
			AccessRightsDetails clsDetails = new AccessRightsDetails();

            bool boShowFinancialReports = false;
            bool boShoweSalesReports = false;
            bool boShowActionBar = false;

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.Contacts);
            if (!clsDetails.Read) divlnkVendors.Style.Add("display", "none");
            lnkVendors.Visible = clsDetails.Read;

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.PurchaseOrders);
            lnkPurchaseOrders.Visible = clsDetails.Read;
            if (!clsDetails.Read) divlnkPurchaseOrders.Style.Add("display", "none");

            lnkPostedPO.Visible = clsDetails.Read;
            if (!clsDetails.Read) divlnkPostedPurchaseOrder.Style.Add("display", "none");

            if (!clsDetails.Read) divlnkPostedPO.Style.Add("display", "none");

            lnkPOAdd.Visible = clsDetails.Write;
            if (!clsDetails.Write) divlnkPOAdd.Style.Add("display", "none");

            // show label for reporting
            if (clsDetails.Write && !boShowFinancialReports) boShowFinancialReports = true;
            if (clsDetails.Write && !boShowActionBar) boShowActionBar = true;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.PurchaseReturns);
            lnkPurchaseReturns.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkPurchaseReturns.Style.Add("display", "none");

            lnkPostedPOReturns.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkPostedPOReturns.Style.Add("display", "none");

            // show label for reporting
            if (clsDetails.Write && !boShowFinancialReports) boShowFinancialReports = true;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.PurchaseDebitMemo);
            lnkPurchaseDebitMemo.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkPurchaseDebitMemo.Style.Add("display", "none");

            lnkPostedDebitMemo.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkPostedDebitMemo.Style.Add("display", "none");

            // show label for reporting
            if (clsDetails.Write && !boShowFinancialReports) boShowFinancialReports = true;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.PurchaseAnalysis);
            lnkPurchaseAnalysis.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkPurchaseAnalysis.Style.Add("display", "none");

            // esales access
            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.PurchaseOrderseSales);
            lnkPurchaseOrdereSales.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkPurchaseOrdereSales.Style.Add("display", "none");

            lnkPostedPOeSales.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkPostedPOeSales.Style.Add("display", "none");

            // show label for reporting
            if (clsDetails.Write && !boShoweSalesReports) boShoweSalesReports = true;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.PurchaseReturnseSales);
            lnkPurchaseReturnseSales.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkPurchaseReturnseSales.Style.Add("display", "none");

            lnkPostedPOReturnseSales.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkPostedPOReturnseSales.Style.Add("display", "none");

            // show label for reporting
            if (clsDetails.Write && !boShoweSalesReports) boShoweSalesReports = true;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.PurchaseDebitMemoeSales);
            lnkPurchaseDebitMemoeSales.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkPurchaseDebitMemoeSales.Style.Add("display", "none");

            lnkPostedDebitMemoeSales.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkPostedDebitMemoeSales.Style.Add("display", "none");

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.PurchaseAnalysiseSales);
            lnkPurchaseAnalysiseSales.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkPurchaseAnalysiseSales.Style.Add("display", "none");

            // show label for reporting
            if (clsDetails.Write && !boShoweSalesReports) boShoweSalesReports = true;

			clsAccessRights.CommitAndDispose();

            // show the actual label for reporting
            if (!boShowFinancialReports)
            {
                divlblFinancialReports.Style.Add("display", "none");
                divtblFinancialReports.Style.Add("display", "none");
            }

            // show the actual label for reporting
            if (!boShoweSalesReports)
            {
                divlbleSalesReports.Style.Add("display", "none");
                divtbleSalesReports.Style.Add("display", "none");
            }

            // show the actual label for reporting
            if (!boShowActionBar)
            {
                divlblActionBar.Style.Add("display", "none");
            }
		}
예제 #27
0
		private void ManageSecurity()
		{
			Int64 UID = Convert.ToInt64(Session["UID"]);
			AccessRights clsAccessRights = new AccessRights(); 
			AccessRightsDetails clsDetails = new AccessRightsDetails();

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.WarehouseToBranchTransfer);
            if (!clsDetails.Read) Server.Transfer(Constants.ROOT_DIRECTORY + "/Home/Default.aspx");
			clsAccessRights.CommitAndDispose();
		}
예제 #28
0
		private void ManageSecurity()
		{
			Int64 UID = Convert.ToInt64(Session["UID"]);
			AccessRights clsAccessRights = new AccessRights(); 
			AccessRightsDetails clsDetails = new AccessRightsDetails();

            bool boShowInventory = false;
            bool boShowActionBar = false;
            bool boShowReports = false;

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.Branch); 
			lnkBranch.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkBranch.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowInventory) boShowInventory = true;

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.InventoryList); 
			lnkInventoryList.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkInventoryList.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowInventory) boShowInventory = true;

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.StockTypes); 
			lnkStockType.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkStockType.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowInventory) boShowInventory = true;

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.StockTransactions); 
			lnkStock.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkStock.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowInventory) boShowInventory = true;

			lnkUpload.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkUpload.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowActionBar) boShowActionBar = true;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.BranchInventoryTransfer);
            lnkBranchTransfer.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkBranchTransfer.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowInventory) boShowInventory = true;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.WarehouseToBranchTransfer);
            lnkWarehouseTransfer.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkWarehouseTransfer.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowInventory) boShowInventory = true;

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.TransferIn);
			lnkTransferIn.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkTransferIn.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowInventory) boShowInventory = true;

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.TransferOut);
			lnkTransferOut.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkTransferOut.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowInventory) boShowInventory = true;

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.InvAdjustment); 
			lnkInvAdjustment.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkInvAdjustment.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowInventory) boShowInventory = true;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.InvThreshold);
            lnkInvThreshold.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkInvThreshold.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowInventory) boShowInventory = true;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.InventoryAnalyst);
            lnkInventoryAnalyst.Visible = clsDetails.Write;
            if (!clsDetails.Write) divlnkInventoryAnalyst.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowActionBar) boShowInventory = true;

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.CloseInventory);
            lnkCloseInventory.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkCloseInventory.Style.Add("display", "none"); 
            
            lnkCloseInventoryProduct.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkCloseInventoryProduct.Style.Add("display", "none");

            lnkCloseInventoryDetailed.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkCloseInventoryDetailed.Style.Add("display", "none");

            lnkCLosingInventoryReport.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkCLosingInventoryReport.Style.Add("display", "none");
            
            // show label for reporting
            if (clsDetails.Read && !boShowActionBar) boShowActionBar = true;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.SynchronizeInventoryCount);
            lnkSynchronize.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkSynchronize.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowActionBar) boShowActionBar = true;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.ExportInventoryCount);
            lnkExport.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkExport.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowActionBar) boShowActionBar = true;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.ImportInventoryCount);
            lnkImport.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkImport.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowActionBar) boShowActionBar = true;

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.InventoryReport); 
			lnkInventory.Visible = clsDetails.Read;
            if (!clsDetails.Read) divlnkInventory.Style.Add("display", "none");

            lnkBranchInventory.Visible = clsDetails.Read;
            if (!clsDetails.Read) divlnkBranchInventory.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowReports) boShowReports = true;

            clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.eInventoryReport); 
            lnkeInventory.Visible = clsDetails.Read;
            if (!clsDetails.Read) divlnkeInventory.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowReports) boShowReports = true;

            //lnkExpiredInventory.Visible = clsDetails.Read; 

            //clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.ReorderReport); 
            //lnkReorder.Visible = clsDetails.Read; 

            //clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.OverStockReport); 
            //lnkOverStock.Visible = clsDetails.Read; 

            //clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.TotalStockReport);
            //lnkTotalStock.Visible = clsDetails.Read; 

			clsAccessRights.CommitAndDispose();

            if (!boShowInventory)
            {
                divlblInventory.Style.Add("display", "none");
                divtblInventory.Style.Add("display", "none");
            }

            if (!boShowActionBar)
            {
                divlblActionBar.Style.Add("display", "none");
            }

            if (!boShowReports)
            {
                divlblReports.Style.Add("display", "none");
            }
		}
예제 #29
0
		private void ManageSecurity()
		{
			Int64 UID = Convert.ToInt64(Session["UID"]);
			AccessRights clsAccessRights = new AccessRights(); 
			AccessRightsDetails clsDetails = new AccessRightsDetails();

            bool boShowAdminFiles = false;
            bool boShowActionBar = false;

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.CompanyInfo); 
			lnkCompany.Visible = clsDetails.Read;
            if (!clsDetails.Read) divlnkCompany.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowAdminFiles) boShowAdminFiles = true;

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.Terminal); 
			lnkTerminal.Visible = clsDetails.Read;
            if (!clsDetails.Read) divlnkTerminal.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowAdminFiles) boShowAdminFiles = true;

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.AccessGroups); 
			lnkAccessGroup.Visible = clsDetails.Read;
            if (!clsDetails.Read) divlnkAccessGroup.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowAdminFiles) boShowAdminFiles = true;

			lnkAccessGroupAdd.Visible = clsDetails.Write;
            if (!clsDetails.Write) divlnkAccessGroupAdd.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Write && !boShowActionBar) boShowActionBar = true;

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.AccessUsers); 
			lnkAccessUser.Visible = clsDetails.Read;
            if (!clsDetails.Read) divlnkAccessUser.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowAdminFiles) boShowAdminFiles = true;

			lnkAccessUserAdd.Visible = clsDetails.Write;
            if (!clsDetails.Write) divlnkAccessUserAdd.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Write && !boShowActionBar) boShowActionBar = true;

			clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.ReportFormat); 
			lnkReceiptFormat.Visible = clsDetails.Read;
            if (!clsDetails.Read) divlnkReceiptFormat.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Read && !boShowAdminFiles) boShowAdminFiles = true;

			lnkReceiptFormatEdit.Visible = clsDetails.Write;
            if (!clsDetails.Write) divlnkReceiptFormatEdit.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Write && !boShowActionBar) boShowActionBar = true;

            clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.RewardPointsSetup);
            lnkRewardPointSystem.Visible = clsDetails.Read;
            if (!clsDetails.Write) divlnkRewardPointSystem.Style.Add("display", "none");
            // show label for reporting
            if (clsDetails.Write && !boShowActionBar) boShowActionBar = true;

			clsAccessRights.CommitAndDispose();

            if (!boShowAdminFiles)
            {
                divlblAdminFiles.Style.Add("display", "none");
                divtblAdminFiles.Style.Add("display", "none");
            }

            if (!boShowActionBar)
            {
                divlblActionBar.Style.Add("display", "none");
            }
		}