Пример #1
0
        private void GetNewPolicyID(ref ConnectionManager conManager, ref CustomList <LeavePolicyMaster> LeavePolicyMasterList, ref CustomList <LeavePolicyDetails> LeavePolicyDetailsList)
        {
            String newLeavePolicyID = String.Empty;

            try
            {
                CustomList <LeavePolicyMaster> tempLeavePolicyMasterList = LeavePolicyMasterList.FindAll(f => f.IsAdded);
                if (tempLeavePolicyMasterList.Count != 0)
                {
                    newLeavePolicyID = StaticInfo.MakeUniqueCode("LeavePolicyID", 20, DateTime.Today.ToString(), "yy", "LPI", "-", "");
                    LeavePolicyMasterList[0].LeavePolicyID = newLeavePolicyID.ToInt();
                    leavePolicyID = newLeavePolicyID;
                }
                else
                {
                    leavePolicyID = LeavePolicyMasterList[0].LeavePolicyID.ToString();
                }

                CustomList <LeavePolicyDetails> tempLeavePolicyDetailsList = LeavePolicyDetailsList.FindAll(f => f.IsAdded);
                foreach (LeavePolicyDetails lPD in tempLeavePolicyDetailsList)
                {
                    lPD.LeavePolicyID = leavePolicyID.ToInt();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #2
0
        private void GetNewSecurityRuleID(ref ConnectionManager conManager, ref CustomList <SecurityRule> securityRuleList, ref CustomList <RuleDetails> securityRuleDetailList)
        {
            String newSecurityRuleID = String.Empty;

            try
            {
                CustomList <SecurityRule> tempSecurityRuleList = securityRuleList.FindAll(f => f.IsAdded);
                if (tempSecurityRuleList.Count != 0)
                {
                    newSecurityRuleID = StaticInfo.MakeUniqueCode("SecurityRuleCode", 20, DateTime.Today.ToString(), "yy", "SR", "-", "");
                    securityRuleList[0].SecurityRuleCode = newSecurityRuleID;
                    securityRuleInfoID = newSecurityRuleID;
                }
                else
                {
                    securityRuleInfoID = securityRuleList[0].SecurityRuleCode;
                }

                CustomList <RuleDetails> tempSecurityRuleDetailList = securityRuleDetailList.FindAll(f => f.IsAdded);
                foreach (RuleDetails sRO in tempSecurityRuleDetailList)
                {
                    sRO.SecurityRuleCode = securityRuleList[0].SecurityRuleCode;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #3
0
        private void GetNewLoanCode(ref ConnectionManager conManager, ref CustomList <LoanDefination> LoanDefinationList, ref CustomList <LoanProcess> LoanProcessList)
        {
            String newLoanCode = String.Empty;

            try
            {
                CustomList <LoanDefination> addedLoanDefinationList = LoanDefinationList.FindAll(f => f.IsAdded);
                if (addedLoanDefinationList.Count != 0)
                {
                    newLoanCode = StaticInfo.MakeUniqueCode("LoanCode", 20, DateTime.Today.ToString(), "yy", "LC", "-", "");
                    LoanDefinationList[0].LoanCode = newLoanCode;
                    loanCode = newLoanCode;
                }
                else
                {
                    loanCode = LoanDefinationList[0].LoanCode;
                }
                CustomList <LoanProcess> AddedLoanProcess = LoanProcessList.FindAll(f => f.IsAdded);
                foreach (LoanProcess lP in AddedLoanProcess)
                {
                    lP.LoanCode = LoanDefinationList[0].LoanCode;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #4
0
        private void GetNewCode(ref ConnectionManager conManager, ref CustomList <HRM_Emp> EmpList)
        {
            String newEmpCode = String.Empty;

            try
            {
                CustomList <HRM_Emp> addedEmpList = EmpList.FindAll(f => f.IsAdded);
                if (addedEmpList.Count != 0)
                {
                    newEmpCode = StaticInfo.MakeUniqueCode(ref conManager, "EmpCode", 20, DateTime.Today.ToString(), "yy", "Emp", "-", "");
                    addedEmpList[0].EmpCode = newEmpCode;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #5
0
        private void GetNewItemCode(ref ConnectionManager conManager, ref CustomList <ItemMaster> lstItemMaster)
        {
            String newItemMasterID = String.Empty;

            try
            {
                CustomList <ItemMaster> tempItemMasterList = lstItemMaster.FindAll(f => f.IsAdded);
                if (tempItemMasterList.Count != 0)
                {
                    newItemMasterID           = StaticInfo.MakeUniqueCode("ItemCode", 20, DateTime.Today.ToString(), "yy", "I", "-", "");
                    lstItemMaster[0].ItemCode = newItemMasterID;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #6
0
        private void GetNewStockTransaction(ref ConnectionManager conManager, ref CustomList <StockTransactionMaster> lstStockTransactionMaster)
        {
            String newCustomCode = String.Empty;

            try
            {
                CustomList <StockTransactionMaster> tempStockTransactionMaster = lstStockTransactionMaster.FindAll(f => f.IsAdded);
                if (tempStockTransactionMaster.Count != 0)
                {
                    newCustomCode = StaticInfo.MakeUniqueCode("CustomCode", 20, DateTime.Today.ToString(), "yy", "ST", "-", "");
                    tempStockTransactionMaster[0].CustomCode = newCustomCode;
                    customCode = newCustomCode;
                }
                else
                {
                    customCode = lstStockTransactionMaster[0].CustomCode;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #7
0
        private void GetNewRequisitionNo(ref ConnectionManager conManager, ref CustomList <ItemRequisitionMaster> lstItemRequisitionMaster)
        {
            String newRequisitionNo = String.Empty;

            try
            {
                CustomList <ItemRequisitionMaster> tempItemRequisitionMaster = lstItemRequisitionMaster.FindAll(f => f.IsAdded);
                if (tempItemRequisitionMaster.Count != 0)
                {
                    newRequisitionNo = StaticInfo.MakeUniqueCode("CustomCode", 20, DateTime.Today.ToString(), "yy", "RNO", "-", "");
                    lstItemRequisitionMaster[0].CustomCode = newRequisitionNo;
                    customCode = newRequisitionNo;
                }
                else
                {
                    customCode = lstItemRequisitionMaster[0].CustomCode;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void GetNewGroupID(ref ConnectionManager conManager, ref CustomList <Group> groupList, ref CustomList <GroupRule> groupSecurityRuleList, ref CustomList <UserGroup> userGroupList)
        {
            String newGroupID = String.Empty;

            try
            {
                CustomList <Group> tempGroupList = groupList.FindAll(f => f.IsAdded);
                if (tempGroupList.Count != 0)
                {
                    foreach (Group group in groupList)
                    {
                        newGroupID      = StaticInfo.MakeUniqueCode("GroupCode", 20, DateTime.Today.ToString(), "yy", "G", "-", "");
                        group.GroupCode = newGroupID;
                        groupID         = newGroupID;
                    }
                }
                else
                {
                    groupID = groupList[0].GroupCode;
                }

                CustomList <GroupRule> tempGroupSecurityRuleList = groupSecurityRuleList.FindAll(f => f.IsAdded);
                foreach (GroupRule gSR in tempGroupSecurityRuleList)
                {
                    gSR.GroupCode = groupID;
                }
                CustomList <UserGroup> tempUserGroupList = userGroupList.FindAll(f => f.IsAdded);
                foreach (UserGroup uG in tempUserGroupList)
                {
                    uG.GroupCode = groupID;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void GetNewSalaryRuleCode(ref ConnectionManager conManager, ref CustomList <SalaryRuleBackup> SalaryRuleBackupList, ref CustomList <SalaryRule> SalaryRuleList)
        {
            String newSalaryRuleCode = String.Empty;

            try
            {
                CustomList <SalaryRuleBackup> addedSalaryRuleList = SalaryRuleBackupList.FindAll(f => f.IsAdded);
                if (addedSalaryRuleList.Count != 0)
                {
                    newSalaryRuleCode = StaticInfo.MakeUniqueCode("SalaryRuleCode", 20, DateTime.Today.ToString(), "yy", "SRC", "-", "");
                    SalaryRuleBackupList.ForEach(f => f.SalaryRuleCode = newSalaryRuleCode);
                    SalaryRuleList.ForEach(f => f.SalaryRuleCode       = newSalaryRuleCode);
                    salaryRuleCode = newSalaryRuleCode;
                }
                else
                {
                    salaryRuleCode = SalaryRuleBackupList[0].SalaryRuleCode;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #10
0
        private void GetNewUserID(ref ConnectionManager conManager, ref CustomList <Users> userList)
        {
            String newUserCode = String.Empty;

            try
            {
                CustomList <Users> addedUserList = userList.FindAll(f => f.IsAdded);
                if (addedUserList.Count != 0)
                {
                    newUserCode = StaticInfo.MakeUniqueCode(ref conManager, "Usercode", 20, DateTime.Today.ToString(), "yy", "UI", "-", "");
                    //user.UserCode = newUserCode;
                    userList[0].UserCode = newUserCode;
                    userCode             = newUserCode;
                }
                else
                {
                    userCode = userList[0].UserCode;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }