public static DefaultFeeSetup DataRowToObject(DataRow dr)
        {
            DefaultFeeSetup TheFee = new DefaultFeeSetup
            {
                QualID         = int.Parse(dr["QualID"].ToString()),
                StreamID       = int.Parse(dr["StreamID"].ToString()),
                STREAM         = dr["STREAM"].ToString(),
                QUALIFICATION  = dr["QUALIFICATION"].ToString(),
                AccountTypeID  = int.Parse(dr["AccountTypeID"].ToString()),
                ACCOUNT_TYPE   = dr["ACCOUNT_TYPE"].ToString(),
                ACCOUNT_CODE   = dr["ACCOUNT_CODE"].ToString(),
                AccountGroupID = int.Parse(dr["AccountGroupID"].ToString()),
                ACCOUNT_GROUP  = dr["ACCOUNT_GROUP"].ToString(),
                AccountID      = int.Parse(dr["AccountID"].ToString()),
                ACCOUNT_NAME   = dr["ACCOUNT_NAME"].ToString(),
                DefaultFee     = decimal.Parse(MicroGlobals.ReturnZeroIfNull(dr["DefaultFee"].ToString())),
                IsActive       = bool.Parse(dr["IsActive"].ToString()),
                IsDeleted      = bool.Parse(dr["IsDeleted"].ToString()),
                AddedBy        = int.Parse(dr["AddedBy"].ToString()),
                OfficeID       = int.Parse(dr["OfficeID"].ToString()),
                CompanyID      = int.Parse(dr["CompanyID"].ToString()),
            };

            return(TheFee);
        }
        public static List <DefaultFeeSetup> GetDefaultFeeListByQual_Stream(int QualID, int StreamID)
        {
            List <DefaultFeeSetup> FeeList = new List <DefaultFeeSetup>();

            DataTable GetDefaultFee = DefaultFeeDataAccess.GetInstance.GetDefaultFeeListByQual_Stream(QualID, StreamID);

            foreach (DataRow dr in GetDefaultFee.Rows)
            {
                DefaultFeeSetup TheFee = DataRowToObject(dr);
                FeeList.Add(TheFee);
            }
            return(FeeList);
        }
Пример #3
0
        private int InsertDefaultFee()
        {
            int Returnvalue = 0;

            DefaultFeeSetup TheFees = new DefaultFeeSetup();

            TheFees.QualID         = int.Parse(ddl_Qualification.SelectedValue);
            TheFees.StreamID       = int.Parse(DropDown_StreamList.SelectedValue);
            TheFees.AccountTypeID  = int.Parse(ddl_ParentAccountGroup.SelectedValue);
            TheFees.AccountGroupID = int.Parse(ddl_AccountGroup.SelectedValue);
            TheFees.AccountID      = int.Parse(ddl_AccountHeads.SelectedValue);
            TheFees.AddedBy        = 1;
            TheFees.DefaultFee     = decimal.Parse(txt_DefaultAmount.Text);
            Returnvalue            = DefaultFeeManagement.GetInstance.InsertDefaultFee(TheFees);
            return(Returnvalue);
        }
        public int InsertDefaultAccountFee(DefaultFeeSetup theFeeSetup)
        {
            int ReturnValue = 0;

            using (SqlCommand InsertCommand = new SqlCommand())
            {
                InsertCommand.CommandType = CommandType.StoredProcedure;
                InsertCommand.Parameters.Add(GetParameter("@ReturnValue", SqlDbType.Int, ReturnValue)).Direction = ParameterDirection.Output;
                InsertCommand.Parameters.Add(GetParameter("@QualID", SqlDbType.Int, theFeeSetup.QualID));
                InsertCommand.Parameters.Add(GetParameter("@StreamID", SqlDbType.Int, theFeeSetup.StreamID));
                InsertCommand.Parameters.Add(GetParameter("@AccountTypeID", SqlDbType.Int, theFeeSetup.AccountTypeID));
                InsertCommand.Parameters.Add(GetParameter("@AccountGroupID", SqlDbType.Int, theFeeSetup.AccountGroupID));
                InsertCommand.Parameters.Add(GetParameter("@AccountID", SqlDbType.Int, theFeeSetup.AccountID));
                InsertCommand.Parameters.Add(GetParameter("@DefaultFee", SqlDbType.Decimal, theFeeSetup.DefaultFee));
                InsertCommand.Parameters.Add(GetParameter("@OfficeID", SqlDbType.Int, 44));//TO DO KP
                InsertCommand.Parameters.Add(GetParameter("@AddedBy", SqlDbType.Int, 1));
                InsertCommand.CommandText = "pICAS_FIN_DefaultFee_Insert";
                ExecuteStoredProcedure(InsertCommand);
                ReturnValue = int.Parse(InsertCommand.Parameters[0].Value.ToString());
                return(ReturnValue);
            }
        }
 public static int InsertDefaultFee(DefaultFeeSetup thesetup)
 {
     return(DefaultFeeDataAccess.GetInstance.InsertDefaultAccountFee(thesetup));
 }
 public int InsertDefaultFee(DefaultFeeSetup theFee)
 {
     return(DefaultFeeIntegration.InsertDefaultFee(theFee));
 }