Esempio n. 1
0
        private void SetLookUp(string lookupName)
        {
            try
            {
                Name = lookupName.Trim();

                if (LookUpType.Equals(CommonEnums.LookUps.Item))
                {
                    ItemList = new ItemDAL().GetAllItemsForLookUp();
                    dataGridViewLookUpData.DataSource = ItemList;
                }
                else if (LookUpType.Equals(CommonEnums.LookUps.MeasuringUnit))
                {
                    measuringUnitList = new MeasuringUnitDAL().GetAllMeasuringUnitsForLookUp();
                    dataGridViewLookUpData.DataSource = measuringUnitList;
                }
                else if (LookUpType.Equals(CommonEnums.LookUps.user))
                {
                    userList = new UserDAL().GetAllUsersForLookUp();
                    dataGridViewLookUpData.DataSource = userList;
                }
                else if (LookUpType.Equals(CommonEnums.LookUps.subItem))
                {
                    subItemList = new SubItemDAL().GetAllSubItemsForLookUp();
                    dataGridViewLookUpData.DataSource = subItemList;

                }
                else if (LookUpType.Equals(CommonEnums.LookUps.role))
                {
                    roleList = new RoleDAL().GetRolesLookUp();
                    dataGridViewLookUpData.DataSource = roleList;

                }
                else if (LookUpType.Equals(CommonEnums.LookUps.screen))
                {
                    screenList = new ScreenDAL().LoadScreensForLookUp();
                    dataGridViewLookUpData.DataSource = screenList;

                }
                else if (LookUpType.Equals(CommonEnums.LookUps.invoice))
                {
                    invoiceList = new InvoiceDAL().LoadAllInvoicesForLookUp();
                    dataGridViewLookUpData.DataSource = invoiceList;

                }
                CellResize();
                PopulateCombo();

                if (!string.IsNullOrEmpty(InitialValue))
                {
                    textBoxValue.Text = InitialValue;
                    buttonFind_Click(null, null);
                }

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 2
0
        private void Main_Load(object sender, EventArgs e)
        {
            if (Common.User.UserRoles.Count > 0)
            {
                var screenList = new ScreenDAL().LoadScreensByRoleID(Common.User.UserRoles[0].RoleId);
                CommonMethods.SetMenueForUser(menuStrip, screenList);
                Common.Screens = screenList;

                toolStripStatusLabel.Text = "System Date : "+ new DayProcessDAL().GetCurrentDayProcessDate().ToString("dd-MMM-yyyy");
            }
        }
Esempio n. 3
0
        private RoleBO FillRole(SqlDataReader drRoleList,bool isLight)
        {
            RoleBO objRole = new RoleBO();
               try
               {
               objRole.RoleId = drRoleList.GetInt32(drRoleList.GetOrdinal("RoleId"));
               objRole.RoleName = drRoleList.GetValue(drRoleList.GetOrdinal("RoleName")).ToString();
               objRole.IsActive = drRoleList.GetBoolean(drRoleList.GetOrdinal("IsActive"));
               objRole.CreatedUser = drRoleList.GetInt32(drRoleList.GetOrdinal("CreatedUser"));
               objRole.CreatedDate = drRoleList.GetDateTime(drRoleList.GetOrdinal("CreatedDate"));
               objRole.ModifiedUser = drRoleList.GetInt32(drRoleList.GetOrdinal("ModifiedUser"));
               objRole.ModifiedDate = drRoleList.GetDateTime(drRoleList.GetOrdinal("ModifiedDate"));

               if (objRole.IsActive)
               {
                   objRole.IsActiveStatus = "Yes";
               }
               else
               {
                   objRole.IsActiveStatus = "No";

               }

               if (!isLight)
               {
                   ScreenDAL screen = new ScreenDAL();

                   List<ScreenBO> listScreen = screen.LoadScreensByRoleID(objRole.RoleId);

                   if (listScreen.Count > 0)
                   {
                       objRole.ScreenList = new List<ScreenBO>();
                       objRole.ScreenList.AddRange(screen.LoadScreensByRoleID(objRole.RoleId));
                   }
               }

               }
               catch
               {
               throw;
               }

               return objRole;
        }