コード例 #1
0
ファイル: StudentDAL.cs プロジェクト: Anand8399/digiSMS
        public void UpdateTCDetails(int StudentId)
        {
            Hashtable parameterlist = new Hashtable();

            parameterlist.Add("@StudentId", StudentId);
            CommanMethodsForSQL.ExecuteNonQueryProcedure("sp_UpdateStudentTCStatus", parameterlist);
        }
コード例 #2
0
ファイル: ClassDAL.cs プロジェクト: Anand8399/digiSMS
        public IQueryable <Class> GetAll()
        {
            try
            {
                List <Class> entites   = new List <Class>();
                DataTable    dataTable = CommanMethodsForSQL.GetDataTable("SELECT ClassId, ClassDetails.Class, "
                                                                          + " ClassDetails.Status, ClassDetails.Remark FROM ClassDetails;");
                if (dataTable != null && dataTable.Rows.Count > 0)
                {
                    foreach (DataRow dr in dataTable.Rows)
                    {
                        if (dr != null)
                        {
                            Class entity = new Class();
                            entity.ClassId   = Convert.ToInt32(dr["ClassId"]);
                            entity.ClassName = dr["Class"].ToString();
                            entity.Status    = Convert.ToBoolean(dr["Status"].ToString());
                            entity.Remark    = dr["Remark"].ToString();
                            entites.Add(entity);
                        }
                    }
                }

                return(entites.AsQueryable());
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #3
0
ファイル: StudentDAL.cs プロジェクト: Anand8399/digiSMS
        public IQueryable <StudentClassChange> GetStudentClassChange(int ClassDivisionId, int schoolId)
        {
            try
            {
                List <StudentClassChange> entities = new List <StudentClassChange>();
                Hashtable parameterlist            = new Hashtable();
                parameterlist.Add("@ClassDivisionId", ClassDivisionId);
                parameterlist.Add("@SchoolId", schoolId);
                //ExecuteProcedureReader
                DataSet ds = CommanMethodsForSQL.ExecuteProcedureReader("sp_GetStudentByClassDivision", parameterlist);

                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        if (dr != null)
                        {
                            StudentClassChange entity = new StudentClassChange();
                            entity.StudentId = Convert.ToInt32(dr["StudentId"]);
                            entity.StudentFullNameWithTitle = Convert.ToString(dr["StudentName"]);
                            entity.RegisterId = Convert.ToInt32(dr["RegisterId"]);
                            entities.Add(entity);
                        }
                    }
                }

                return(entities.AsQueryable());
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #4
0
ファイル: AcademicYearDAL.cs プロジェクト: Anand8399/digiSMS
        public IQueryable <AcademicYear> GetAll()
        {
            try
            {
                List <AcademicYear> entites   = new List <AcademicYear>();
                DataTable           dataTable = CommanMethodsForSQL.GetDataTable("SELECT AcademicYearId, LTRIM(RTRIM(AcademicYear)) AS AcademicYear, StartDate, EndDate, Status, Remark "
                                                                                 + " FROM AcademicYearDetails;");
                if (dataTable != null && dataTable.Rows.Count > 0)
                {
                    foreach (DataRow dr in dataTable.Rows)
                    {
                        if (dr != null)
                        {
                            AcademicYear entity = new AcademicYear();
                            entity.AcademicYearId   = Convert.ToInt32(dr["AcademicYearId"]);
                            entity.AcademicYearName = dr["AcademicYear"].ToString();
                            entity.StartDate        = Convert.ToDateTime(dr["StartDate"]);
                            entity.EndDate          = Convert.ToDateTime(dr["EndDate"]);
                            entity.Status           = Convert.ToBoolean(dr["Status"].ToString());
                            entity.Remark           = dr["Remark"].ToString();
                            entites.Add(entity);
                        }
                    }
                }

                return(entites.AsQueryable());
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #5
0
        public void Edit(FeeClassDivision entity)
        {
            try
            {
                //        string queryString = string.Format(" UPDATE [FeeClassDivisionDetails] " +
                //" SET [AcademicYearId] = {0}" +
                //  ",[FeeHeadId] = {1}" +
                //  ",[ClassDivisionId] = {2}" +
                //  ",[PeriodInMonthly] ={3}" +
                //  ",[AmountInMonthly] = {4}" +
                //  ",[AmountInYearly] = {5}" +
                //  ",[Status] = {6}" +
                //  ",[Remark] = '{7}'" +
                //" WHERE FeeClassDivisionId  = {8};"
                //,entity.AcademicYearId, entity.FeeHeadId, entity.ClassDivisionId, entity.PeriodInMonthly,
                //entity.AmountInMonthly, entity.AmountInYearly, entity.Status == true ? 1 : 0, entity.Remark, entity.FeeClassDivisionId);
                //        int effetedRows = CommanMethodsForSQL.ExecuteNonQuery(queryString);
                Hashtable parameterlist = new Hashtable();
                parameterlist.Add("@FeeHeadId", entity.FeeHeadId);
                parameterlist.Add("@ClassDivisionId", entity.ClassDivisionId);
                parameterlist.Add("@PeriodInMonthly", entity.PeriodInMonthly);
                parameterlist.Add("@AmountInMonthly", entity.AmountInMonthly);
                parameterlist.Add("@AmountInYearly", entity.AmountInYearly);
                parameterlist.Add("@Status", entity.Status);
                parameterlist.Add("@Remark", entity.Remark);
                parameterlist.Add("@FeeClassDivisionId", entity.FeeClassDivisionId);


                int effetedRows = CommanMethodsForSQL.ExecuteNonQueryProcedure("sp_FeeClassDivisionUpdate", parameterlist);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #6
0
        public void AddStudentAttendance(List <StudentAttendance> entities)
        {
            try
            {
                Hashtable parameterlist;

                foreach (var entity in entities)
                {
                    parameterlist = new Hashtable();

                    parameterlist.Add("@ClassId", entity.ClassId);
                    parameterlist.Add("@DivisionId", entity.DivisionId);
                    parameterlist.Add("@DateOfAttendance", entity.DateOfAttendance);
                    parameterlist.Add("@StudentId", entity.StudentId);
                    parameterlist.Add("@AttendanceInDays", entity.AttendanceInDays);
                    parameterlist.Add("@AbsentRemark", entity.AbsentRemark);

                    Hashtable outparameterlist = new Hashtable();
                    int       effetedRows      = CommanMethodsForSQL.ExecuteNonQueryProcedure("sp_StudentAttendanceInsert", parameterlist);
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #7
0
ファイル: ReligionDAL.cs プロジェクト: Anand8399/digiSMS
        public IQueryable <Religion> GetAll()
        {
            try
            {
                List <Religion> entites   = new List <Religion>();
                DataTable       dataTable = CommanMethodsForSQL.GetDataTable("SELECT ReligionDetails.ReligionId, LTRIM(RTRIM(ReligionDetails.Religion)) AS Religion, "
                                                                             + " ReligionDetails.Status, ReligionDetails.Remark"
                                                                             + " FROM  ReligionDetails;");
                if (dataTable != null && dataTable.Rows.Count > 0)
                {
                    foreach (DataRow dr in dataTable.Rows)
                    {
                        if (dr != null)
                        {
                            Religion entity = new Religion();
                            entity.ReligionId   = Convert.ToInt32(dr["ReligionId"]);
                            entity.ReligionName = Convert.ToString(dr["Religion"]);
                            entity.Status       = Convert.ToBoolean(dr["Status"].ToString());
                            entity.Remark       = dr["Remark"].ToString();
                            entites.Add(entity);
                        }
                    }
                }

                return(entites.AsQueryable());
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #8
0
        public IQueryable <Country> GetAll()
        {
            try
            {
                List <Country> entites   = new List <Country>();
                DataTable      dataTable = CommanMethodsForSQL.GetDataTable("SELECT CountryDetails.CountryId, RTRIM(LTRIM(CountryDetails.Country)) AS Country, CountryDetails.[Status], CountryDetails.Remark "
                                                                            + " FROM         CountryDetails ;");
                if (dataTable != null && dataTable.Rows.Count > 0)
                {
                    foreach (DataRow dr in dataTable.Rows)
                    {
                        if (dr != null)
                        {
                            Country entity = new Country();
                            entity.CountryId   = Convert.ToInt32(dr["CountryId"]);
                            entity.CountryName = dr["Country"].ToString();
                            entity.Status      = Convert.ToBoolean(dr["Status"].ToString());
                            entity.Remark      = dr["Remark"].ToString();
                            entites.Add(entity);
                        }
                    }
                }

                return(entites.AsQueryable());
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #9
0
ファイル: AssetDAL.cs プロジェクト: Anand8399/digiSMS
        public void Add(Asset entity, int schoolId)
        {
            try
            {
                Hashtable parameterlist = new Hashtable();

                parameterlist.Add("@SchoolId", schoolId);
                parameterlist.Add("@TypeofAsset", entity.TypeofAsset);
                parameterlist.Add("@AssetName", entity.AssetName);
                parameterlist.Add("@Quantity", entity.Quantity);
                parameterlist.Add("@PricePerItem", entity.PricePerItem);
                parameterlist.Add("@Total", entity.Quantity * entity.PricePerItem);// entity.Total);
                parameterlist.Add("@PurchaseDate", entity.PurchaseDate);
                parameterlist.Add("@Condition", entity.Condition);
                parameterlist.Add("@AssesmentYear", entity.AssesmentYear);
                parameterlist.Add("@Status", entity.Status == true ? 1 : 0);
                parameterlist.Add("@Remark", entity.Remark);

                int effetedRows = CommanMethodsForSQL.ExecuteNonQueryProcedure("sp_InsertAssetDetails", parameterlist);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #10
0
 public void Edit(Account entity)
 {
     try
     {
         string queryString = string.Format(" UPDATE [Account] " +
                                            " SET [NarrationDetails] = N'{0}'" +
                                            ",[TransactionType] = N'{1}'" +
                                            ",[PaymentMode] = N'{2}'" +
                                            ",[Amount] = '{3}'" +
                                            //",[Balance] = '{4}'" +
                                            ",[TransactionDate]= GETDATE()" +
                                            ",[Remark]='{4}'" +
                                            ",[CustomerName]=N'{5}'" +
                                            ",[BankName]=N'{6}'" +
                                            ",[ChqDDNumber]=N'{7}'" +
                                            ",[ContactNo]=N'{8}'" +
                                            " WHERE SrNo  = {9};", entity.NarrationDetails, entity.TransactionType, entity.PaymentMode, entity.Amount,
                                            entity.Remark, entity.CustomerName, entity.BankName, entity.ChqDDNumber,
                                            entity.ContactNo, entity.SrNo);
         string s           = queryString;
         int    effetedRows = CommanMethodsForSQL.ExecuteNonQuery(queryString);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #11
0
ファイル: AcademicYearDAL.cs プロジェクト: Anand8399/digiSMS
        public void Edit(AcademicYear entity)
        {
            try
            {
                //        string queryString = string.Format(" UPDATE [AcademicYearDetails] " +
                //" SET [AcademicYear] = '{0}'" +
                //  ",[StartDate] = '{1}'" +
                //  ",[EndDate] = '{2}'" +
                //  ",[Status] = '{3}'" +
                //  ",[Remark] = '{4}'" +
                //" WHERE AcademicYearId  = {5};", entity.AcademicYearName, entity.StartDate, entity.EndDate, entity.Status, entity.Remark, entity.AcademicYearId);
                //        int effetedRows = CommanMethodsForSQL.ExecuteNonQuery(queryString);
                Hashtable parameterlist = new Hashtable();
                parameterlist.Add("@AcademicYearName", entity.AcademicYearName);
                parameterlist.Add("@StartDate", entity.StartDate);
                parameterlist.Add("@EndDate", entity.EndDate);
                parameterlist.Add("@Status", entity.Status);
                parameterlist.Add("@Remark", entity.Remark);
                parameterlist.Add("@AcademicYearId", entity.AcademicYearId);

                int effetedRows = CommanMethodsForSQL.ExecuteNonQueryProcedure("sp_AcademicYearUpdate", parameterlist);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #12
0
ファイル: ReligionDAL.cs プロジェクト: Anand8399/digiSMS
        public void Edit(Religion entity)
        {
            try
            {
                //        string queryString = string.Format(" UPDATE [ReligionDetails] " +
                //" SET [AcademicYearId] = {0}" +
                //  ",[Religion] = '{1}'" +
                //  ",[Status] = '{2}'" +
                //  ",[Remark] = '{3}'" +
                //" WHERE [ReligionId]  = {4};", entity.AcademicYearId, entity.ReligionName, entity.Status, entity.Remark, entity.ReligionId);
                //        int effetedRows = CommanMethodsForSQL.ExecuteNonQuery(queryString);

                Hashtable parameterlist = new Hashtable();
                parameterlist.Add("@Religion", entity.ReligionName);
                parameterlist.Add("@Status", entity.Status);
                parameterlist.Add("@Remark", entity.Remark);
                parameterlist.Add("@ReligionId", entity.ReligionId);

                int effetedRows = CommanMethodsForSQL.ExecuteNonQueryProcedure("sp_ReligionDetailsUpdate", parameterlist);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #13
0
ファイル: RoleDAL.cs プロジェクト: Anand8399/digiSMS
        public IQueryable <Role> GetAll()
        {
            try
            {
                List <Role> entites   = new List <Role>();
                DataTable   dataTable = CommanMethodsForSQL.GetDataTable("SELECT RoleDetails.* FROM RoleDetails;");
                if (dataTable != null && dataTable.Rows.Count > 0)
                {
                    foreach (DataRow dr in dataTable.Rows)
                    {
                        if (dr != null)
                        {
                            Role entity = new Role();
                            entity.Id       = Convert.ToInt32(dr["RoleId"]);
                            entity.RoleName = dr["Role"].ToString();
                            entity.Status   = Convert.ToBoolean(dr["Status"].ToString());
                            entity.Remark   = dr["Remark"].ToString();
                            entites.Add(entity);
                        }
                    }
                }

                return(entites.AsQueryable());
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #14
0
        public IQueryable <Cast> GetAll()
        {
            try
            {
                List <Cast> entites   = new List <Cast>();
                DataTable   dataTable = CommanMethodsForSQL.GetDataTable("SELECT CastId, LTRIM(RTRIM([Cast])) as CastName, Status, Remark FROM CastDetails;");
                if (dataTable != null && dataTable.Rows.Count > 0)
                {
                    foreach (DataRow dr in dataTable.Rows)
                    {
                        if (dr != null)
                        {
                            Cast entity = new Cast();
                            entity.CastId   = Convert.ToInt32(dr["CastId"]);
                            entity.CastName = Convert.ToString(dr["CastName"]);
                            entity.Status   = Convert.ToBoolean(dr["Status"].ToString());
                            entity.Remark   = dr["Remark"].ToString();
                            entites.Add(entity);
                        }
                    }
                }

                return(entites.AsQueryable());
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #15
0
        public IQueryable <State> GetAll()
        {
            try
            {
                List <State> entites   = new List <State>();
                DataTable    dataTable = CommanMethodsForSQL.GetDataTable("SELECT     StateDetails.StateId, StateDetails.CountryId, RTRIM(LTRIM(StateDetails.[State])) AS [State], StateDetails.[Status], StateDetails.Remark, "
                                                                          + " RTRIM(LTRIM(CountryDetails.Country)) AS Country "
                                                                          + " FROM         StateDetails INNER JOIN "
                                                                          + " CountryDetails ON StateDetails.CountryId = CountryDetails.CountryId;");
                if (dataTable != null && dataTable.Rows.Count > 0)
                {
                    foreach (DataRow dr in dataTable.Rows)
                    {
                        if (dr != null)
                        {
                            State entity = new State();
                            entity.StateId     = Convert.ToInt32(dr["StateId"]);
                            entity.CountryId   = Convert.ToInt32(dr["CountryId"]);
                            entity.CountryName = dr["Country"].ToString();
                            entity.StateName   = dr["State"].ToString();
                            entity.Status      = Convert.ToBoolean(dr["Status"].ToString());
                            entity.Remark      = dr["Remark"].ToString();
                            entites.Add(entity);
                        }
                    }
                }

                return(entites.AsQueryable());
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #16
0
        public void Edit(City entity)
        {
            try
            {
                //        string queryString = string.Format(" UPDATE [CityDetails] " +
                //" SET [DistrictId] = {0}" +
                //  ",[City] = '{1}'" +
                //  ",[Status] = '{2}'" +
                //  ",[Remark] = '{3}'" +
                //" WHERE CityId  = {4};", entity.DistrictId, entity.CityName, entity.Status, entity.Remark, entity.CityId);
                //        int effetedRows = CommanMethodsForSQL.ExecuteNonQuery(queryString);

                Hashtable parameterlist = new Hashtable();
                parameterlist.Add("@CityId", entity.CityId);
                parameterlist.Add("@DistrictId", entity.DistrictId);
                parameterlist.Add("@City", entity.CityName);
                parameterlist.Add("@Status", entity.Status);
                parameterlist.Add("@Remark", entity.Remark);


                int effetedRows = CommanMethodsForSQL.ExecuteNonQueryProcedure("sp_CityDetailsUpdate", parameterlist);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #17
0
        public IQueryable <City> GetAll()
        {
            try
            {
                List <City> entites   = new List <City>();
                DataTable   dataTable = CommanMethodsForSQL.GetDataTable("SELECT CityDetails.CityId, CityDetails.City, CityDetails.DistrictId, DistrictDetails.District,DistrictDetails.District, CityDetails.Status, CityDetails.Remark"
                                                                         + " FROM CityDetails INNER JOIN DistrictDetails ON CityDetails.DistrictId = DistrictDetails.DistrictId;");

                if (dataTable != null && dataTable.Rows.Count > 0)
                {
                    foreach (DataRow dr in dataTable.Rows)
                    {
                        if (dr != null)
                        {
                            City entity = new City();
                            entity.CityId   = Convert.ToInt32(dr["CityId"]);
                            entity.CityName = dr["City"].ToString();

                            entity.DistrictId   = Convert.ToInt32(dr["DistrictId"]);
                            entity.DistrictName = dr["District"].ToString();
                            entity.Status       = Convert.ToBoolean(dr["Status"].ToString());
                            entity.Remark       = dr["Remark"].ToString();
                            entites.Add(entity);
                        }
                    }
                }

                return(entites.AsQueryable());
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #18
0
ファイル: StudentLedgerDAL.cs プロジェクト: Anand8399/digiSMS
        public void Add(StudentLedger entity)
        {
            try
            {
                //string queryString = string.Format(" INSERT INTO [StudentLedger]([AcademicYearId],[StudentId],[TransactionDate],[FeeHeadId],[Cr],[Dr],[HeadBalance],[Balance],[ReceiptNo],[BankName],[ChequeNumber],[Status],[Remark],[CreatedBy],[CreatedDate],[ModifiedBy],[ModifiedDate]) VALUES({0}, '{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}', '{8}', '{9}', '{10}', '{11}', '{12}', '{13}','{14}','{15}','{16}');"
                //    , entity.AcademicYearId, entity.StudentId, entity.TransactionDate, entity.FeeHeadId, entity.Cr, entity.Dr, entity.HeadBalance, entity.Balance, entity.Status == true ? 1 : 0, entity.Remark, entity.CreatedBy, entity.CreatedDate, entity.ModifiedBy, entity.ModifiedDate);
                //int effetedRows = CommanMethodsForSQL.ExecuteNonQuery(queryString);

                Hashtable parameterlist = new Hashtable();
                parameterlist.Add("@StudentId", entity.StudentId);
                parameterlist.Add("@TransactionDate", entity.TransactionDate);
                parameterlist.Add("@FeeHeadId", entity.FeeHeadId);
                parameterlist.Add("@Cr", entity.Cr);
                parameterlist.Add("@Dr", entity.Dr);
                parameterlist.Add("@HeadBalance", entity.HeadBalance);
                parameterlist.Add("@Balance", entity.Balance);
                parameterlist.Add("@ReceiptNo", entity.ReceiptNo);
                parameterlist.Add("@BankName", entity.BankName);
                parameterlist.Add("@ChequeNumber", entity.ChequeNumber);
                parameterlist.Add("@Status", entity.Status);
                parameterlist.Add("@Remark", entity.Remark);
                parameterlist.Add("@CreatedBy", entity.CreatedBy);
                parameterlist.Add("@CreatedDate", entity.CreatedDate);
                parameterlist.Add("@ModifiedBy", entity.ModifiedBy);
                parameterlist.Add("@ModifiedDate", entity.ModifiedDate);

                int effetedRows = CommanMethodsForSQL.ExecuteNonQueryProcedure("sp_StudentLedgerInsert", parameterlist);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #19
0
        public decimal getLeaveBalance(int employeeId)
        {
            try
            {
                decimal leaveBalance = 0;
                String  SqlQuery     = "SELECT BalanceLeaves from EmployeeLeaveTransaction where EmployeeId=" + employeeId + ";";

                DataTable dataTable = CommanMethodsForSQL.GetDataTable(SqlQuery);
                if (dataTable != null && dataTable.Rows.Count > 0)
                {
                    foreach (DataRow dr in dataTable.Rows)
                    {
                        if (dr != null)
                        {
                            leaveBalance = Convert.ToDecimal(dr["BalanceLeaves"]);
                        }
                    }
                }

                return(leaveBalance);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #20
0
ファイル: UserDAL.cs プロジェクト: Anand8399/digiSMS
        public void ChangePassword(User entity)
        {
            Hashtable parameterlist = new Hashtable();

            parameterlist.Add("@UserId", entity.UserId);
            parameterlist.Add("@Password", entity.Password);
            CommanMethodsForSQL.ExecuteNonQueryProcedure("sp_ChangePassword", parameterlist);
        }
コード例 #21
0
ファイル: StudentDAL.cs プロジェクト: Anand8399/digiSMS
 /// <summary>
 /// Add new student record
 /// </summary>
 /// <param name="entity">Student entity</param>
 /// <returns>Student Id</returns>
 public int AddStudent(Student entity, int SchoolId)
 {
     try
     {
         Hashtable parameterlist = new Hashtable();
         parameterlist.Add("@StudentId", entity.StudentId);
         parameterlist.Add("@SchoolId", SchoolId);
         parameterlist.Add("@RegisterId", entity.RegisterId);
         parameterlist.Add("@ClassDivisionId", entity.ClassDivisionId);
         parameterlist.Add("@Title", entity.Title);
         parameterlist.Add("@FirstName", entity.FirstName);
         parameterlist.Add("@MiddleName", entity.MiddleName);
         parameterlist.Add("@LastName", entity.LastName);
         parameterlist.Add("@MotherName", entity.MotherName);
         parameterlist.Add("@Gender", entity.Gender);
         parameterlist.Add("@Nationality", entity.Nationality);
         parameterlist.Add("@ReligionCastId", entity.ReligionCastId);
         parameterlist.Add("@DateOfBirth", entity.DateOfBirth);
         parameterlist.Add("@PlaceOfBirth", entity.PlaceOfBirth);
         parameterlist.Add("@AdharcardNo", entity.AdharcardNo);
         parameterlist.Add("@DateOfAdmission", entity.DateOfAdmission);
         parameterlist.Add("@MotherTounge", entity.MotherTounge);
         parameterlist.Add("@UStudentId", entity.UStudentId);
         parameterlist.Add("@LastSchoolAttended", entity.LastSchoolAttended);
         parameterlist.Add("@Progress", entity.Progress);
         parameterlist.Add("@Conduct", entity.Conduct);
         parameterlist.Add("@DateOfLeavingSchool", entity.DateOfLeavingSchool);
         parameterlist.Add("@LastSchoolClass", entity.LastSchoolClass);
         parameterlist.Add("@LastSchoolTCNo", entity.LastSchoolTCNo);
         parameterlist.Add("@ClassInWhichStudingAndSinceWhen", entity.ClassInWhichStudingAndSinceWhen);
         parameterlist.Add("@ReasonForLeavingSchool", entity.ReasonForLeavingSchool);
         parameterlist.Add("@RemarkOnTC", entity.RemarkOnTC);
         parameterlist.Add("@Status", entity.Status == true ? 1 : 0);
         parameterlist.Add("@Remark", entity.Remark);
         parameterlist.Add("@PrevSchoolDateofLiving", entity.PrevSchoolDateofLiving);
         parameterlist.Add("@OUT_StudentId", null);
         Hashtable outparameterlist = new Hashtable();
         int       effetedRows      = CommanMethodsForSQL.ExecuteNonQueryProcedure("sp_StudentInsert", parameterlist, ref outparameterlist);
         int       studentId        = 0;
         if (outparameterlist != null && outparameterlist.Count > 0)
         {
             foreach (string parametername in outparameterlist.Keys)
             {
                 if (parametername.StartsWith("@OUT_"))
                 {
                     studentId = Convert.ToInt32(outparameterlist[parametername]);
                 }
             }
         }
         return(studentId);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #22
0
        public IQueryable <Employee> GetAll(int schoolId)
        {
            try
            {
                List <Employee> entites = new List <Employee>();

                String SqlQuery = "select * from Employee";
                if (schoolId != 0)
                {
                    SqlQuery = SqlQuery + " where SchoolId=" + schoolId + ";";
                }


                DataTable dataTable = CommanMethodsForSQL.GetDataTable(SqlQuery);
                if (dataTable != null && dataTable.Rows.Count > 0)
                {
                    foreach (DataRow dr in dataTable.Rows)
                    {
                        if (dr != null)
                        {
                            Employee entity = new Employee();
                            entity.EmployeeId   = Convert.ToInt32(dr["EmployeeId"]);
                            entity.EmployeeCode = Convert.ToString(dr["EmployeeCode"]);
                            entity.Password     = Convert.ToString(dr["Password"]);
                            entity.FirstName    = Convert.ToString(dr["FirstName"]);
                            entity.MiddleName   = Convert.ToString(dr["MiddleName"]);
                            entity.LastName     = Convert.ToString(dr["LastName"]);
                            entity.Category     = Convert.ToString(dr["Category"]);
                            entity.Address      = Convert.ToString(dr["Address"]);
                            entity.ContactNo    = Convert.ToString(dr["ContactNo"]);


                            if (dr["DOB"] != DBNull.Value)
                            {
                                entity.DOB = Convert.ToDateTime(dr["DOB"]);
                            }
                            if (dr["JoiningDate"] != DBNull.Value)
                            {
                                entity.JoiningDate = Convert.ToDateTime(dr["JoiningDate"].ToString());
                            }


                            entites.Add(entity);
                        }
                    }
                }

                return(entites.AsQueryable());
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #23
0
ファイル: StudentLedgerDAL.cs プロジェクト: Anand8399/digiSMS
 public void Delete(int Id)
 {
     try
     {
         string queryString = string.Format(" DELETE FROM [StudentLedger] WHERE StudentLedgerId  = {0};", Id);
         int    effetedRows = CommanMethodsForSQL.ExecuteNonQuery(queryString);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #24
0
ファイル: ReligionDAL.cs プロジェクト: Anand8399/digiSMS
 public void Delete(int Id)
 {
     try
     {
         string queryString = string.Format(" DELETE FROM [ReligionDetails] WHERE ReligionId  = {0};", Id);
         int    effetedRows = CommanMethodsForSQL.ExecuteNonQuery(queryString);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #25
0
        public IQueryable <StudentParent> GetAll()
        {
            try
            {
                List <StudentParent> entites = new List <StudentParent>();
                //DataTable dataTable = CommanMethodsForSQL.GetDataTable("SELECT StudentParentDetails.* FROM StudentParentDetails;");
                Hashtable parameterlist = new Hashtable();
                DataSet   dataSet       = CommanMethodsForSQL.ExecuteProcedureReader("sp_GetAllStudentParentDetails", parameterlist);
                if (dataSet != null && dataSet.Tables.Count > 0 && dataSet.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow dr in dataSet.Tables[0].Rows)
                    {
                        if (dr != null)
                        {
                            StudentParent entity = new StudentParent();
                            entity.StudentId        = Convert.ToInt32(dr["StudentId"]);
                            entity.Title            = Convert.ToString(dr["Title"]);
                            entity.FirstName        = Convert.ToString(dr["FirstName"]);
                            entity.MiddleName       = Convert.ToString(dr["MiddleName"]);
                            entity.LastName         = Convert.ToString(dr["LastName"]);
                            entity.Gender           = Convert.ToString(dr["Gender"]);
                            entity.Address          = Convert.ToString(dr["Address"]);
                            entity.CountryId        = Convert.ToInt32(dr["CountryId"]);
                            entity.StateId          = Convert.ToInt32(dr["StateId"]);
                            entity.DistrictId       = Convert.ToInt32(dr["DistrictId"]);
                            entity.CityId           = Convert.ToInt32(dr["CityId"]);
                            entity.PinCode          = Convert.ToInt32(dr["PinCode"]);
                            entity.MobileNumber     = Convert.ToInt64(dr["MobileNumber"]);
                            entity.ContactNo        = Convert.ToString(dr["ContactNo"]);
                            entity.Occupation       = Convert.ToString(dr["Occupation"]);
                            entity.CompanyName      = Convert.ToString(dr["CompanyName"]);
                            entity.CompanyAddress   = Convert.ToString(dr["CompanyAddress"]);
                            entity.CompanyContactNo = Convert.ToString(dr["CompanyContactNo"]);
                            entity.BankName         = Convert.ToString(dr["BankName"]);
                            entity.AccountNo        = Convert.ToString(dr["AccountNo"]);
                            entity.Branch           = Convert.ToString(dr["Branch"]);
                            entity.IFSCCode         = Convert.ToString(dr["IFSCCode"]);
                            entity.StudentFullName  = Convert.ToString(dr["StudentFullName"]);
                            entity.Status           = Convert.ToBoolean(dr["Status"].ToString());
                            entity.Remark           = dr["Remark"].ToString();
                            entites.Add(entity);
                        }
                    }
                }

                return(entites.AsQueryable());
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #26
0
        public void Edit(StudentAddress entity)
        {
            try
            {
                //string queryString = string.Format(" UPDATE [StudentAddressDetails] " +
                //        " SET [CurrentAddress] ='{0}'"
                //    +", [CurrentCountryId]='{1}'"
                //    +", [CurrentStateId]='{2}'"
                //    +", [CurrentDistrictId]='{3}'"
                //    +", [CurrentCityId]='{4}'"
                //    +", [CurrentPinCode]='{5}'"
                //    +", [PermentAddress]='{6}'"
                //    +", [PermentCountryId]='{7}'"
                //    +", [PermentStateId]='{8}'"
                //    +", [PermentDistrictId]='{9}'"
                //    +", [PermentCityId]='{10}'"
                //    +", [PermentPinCode]='{11}'"
                //     + ",[Status] = '{12}'"
                //      + ",[Remark] = '{13}'"
                //   + " WHERE StudentId  = {14};"
                //   , entity.CurrentAddress, entity.CurrentCountryId, entity.CurrentStateId, entity.CurrentDistrictId, entity.CurrentCityId, entity.CurrentPinCode
                //    , entity.PermentAddress, entity.PermentCountryId, entity.PermentStateId, entity.PermentDistrictId, entity.PermentCityId, entity.PermentPinCode
                //    , entity.Status, entity.Remark, entity.StudentId);
                //int effetedRows = CommanMethodsForSQL.ExecuteNonQuery(queryString);

                Hashtable parameterlist = new Hashtable();
                parameterlist.Add("@StudentId", entity.StudentId);
                parameterlist.Add("@CurrentAddress", entity.CurrentAddress);
                parameterlist.Add("@CurrentCountryId", entity.CurrentCountryId);
                parameterlist.Add("@CurrentStateId", entity.CurrentStateId);
                parameterlist.Add("@CurrentDistrictId", entity.CurrentDistrictId);
                parameterlist.Add("@CurrentCityId", entity.CurrentCityId);
                parameterlist.Add("@CurrentPinCode", entity.CurrentPinCode);
                parameterlist.Add("@PermentAddress", entity.PermentAddress);
                parameterlist.Add("@PermentCountryId", entity.PermentCountryId);
                parameterlist.Add("@PermentStateId", entity.PermentStateId);
                parameterlist.Add("@PermentDistrictId", entity.PermentDistrictId);
                parameterlist.Add("@PermentCityId", entity.PermentCityId);
                parameterlist.Add("@PermentPinCode", entity.PermentPinCode);
                parameterlist.Add("@Status", entity.Status);
                parameterlist.Add("@Remark", entity.Remark);


                int effetedRows = CommanMethodsForSQL.ExecuteNonQueryProcedure("sp_StudentAddressDetailsUpdate", parameterlist);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #27
0
 public void Add(Employee entity, int schoolId)
 {
     try
     {
         string queryString = string.Format("INSERT INTO [Employee]([SchoolId],[EmployeeCode],[Password],[FirstName],[MiddleName],[LastName],[Category],[Address],[ContactNo],[DOB],[JoiningDate])" +
                                            " VALUES( N'{0}', N'{1}',N'{2}',N'{3}', N'{4}', N'{5}', N'{6}',N'{7}', N'{8}', convert(date,'{9}',105), convert(date,'{10}',105)) ;", schoolId, entity.EmployeeCode, entity.Password, entity.FirstName, entity.MiddleName, entity.LastName, entity.Category, entity.Address, entity.ContactNo, entity.DOB, entity.JoiningDate);
         string s           = queryString;
         int    effetedRows = CommanMethodsForSQL.ExecuteNonQuery(queryString);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #28
0
        public IQueryable <StudentAttendance> GetAllStudentAttendance(int ClassId, int DivisionId, DateTime DateOfAttendance)
        {
            try
            {
                List <StudentAttendance> entites = new List <StudentAttendance>();

                Hashtable parameterlist = new Hashtable();
                parameterlist.Add("@ClassId", ClassId);
                parameterlist.Add("@DivisionId", DivisionId);
                parameterlist.Add("@DateOfAttendance", DateOfAttendance);

                DataSet dataSet = CommanMethodsForSQL.ExecuteProcedureReader("sp_StudentAttendanceGet", parameterlist);


                if (dataSet != null && dataSet.Tables.Count > 0 && dataSet.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow dr in dataSet.Tables[0].Rows)
                    {
                        if (dr != null)
                        {
                            StudentAttendance entity = new StudentAttendance();

                            entity.Id = Convert.ToInt32(dr["Id"]);
                            entity.ClassDivisionId = Convert.ToInt32(dr["ClassDivisionId"]);
                            entity.ClassId         = ClassId;
                            entity.DivisionId      = DivisionId;

                            entity.StudentId  = Convert.ToInt32(dr["StudentId"]);
                            entity.RegisterId = Convert.ToInt32(dr["RegisterId"]);
                            entity.StudentFullNameWithTitle = Convert.ToString(dr["StudentFullName"]);
                            if (dr["DateOfAttendance"] != DBNull.Value)
                            {
                                entity.DateOfAttendance = Convert.ToDateTime(dr["DateOfAttendance"]);
                            }
                            entity.AttendanceInDays = Convert.ToDecimal(dr["AttendanceInDays"]);
                            entity.AbsentRemark     = Convert.ToString(dr["AbsentRemark"]).Trim();
                            entity.Status           = Convert.ToBoolean(dr["Status"]);

                            entites.Add(entity);
                        }
                    }
                }

                return(entites.AsQueryable());
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #29
0
        public void Add(StudentAddress entity)
        {
            try
            {
                //string queryString = string.Format(" INSERT INTO [StudentAddressDetails]("
                //    +" [StudentId]"
                //    +", [CurrentAddress]"
                //    +", [CurrentCountryId]"
                //    +", [CurrentStateId]"
                //    +", [CurrentDistrictId]"
                //    +", [CurrentCityId]"
                //    +", [CurrentPinCode]"
                //    +", [PermentAddress]"
                //    +", [PermentCountryId]"
                //    +", [PermentStateId]"
                //    +", [PermentDistrictId]"
                //    +", [PermentCityId]"
                //    +", [PermentPinCode]"
                //    +", [Status]"
                //    +", [Remark]"
                //    + ") VALUES({0}, '{1}','{2}', '{3}', '{4}', '{5}', '{6}', '{7}', '{8}', '{9}', '{10}', '{11}', '{12}', '{13}', '{14}');"
                //    , entity.StudentId, entity.CurrentAddress, entity.CurrentCountryId, entity.CurrentStateId, entity.CurrentDistrictId, entity.CurrentCityId, entity.CurrentPinCode
                //    , entity.PermentAddress, entity.PermentCountryId, entity.PermentStateId, entity.PermentDistrictId, entity.PermentCityId, entity.PermentPinCode
                //    ,entity.Status, entity.Remark);
                //int effetedRows = CommanMethodsForSQL.ExecuteNonQuery(queryString);

                Hashtable parameterlist = new Hashtable();
                parameterlist.Add("@StudentId", entity.StudentId);
                parameterlist.Add("@CurrentAddress", entity.CurrentAddress);
                parameterlist.Add("@CurrentCountryId", entity.CurrentCountryId);
                parameterlist.Add("@CurrentStateId", entity.CurrentStateId);
                parameterlist.Add("@CurrentDistrictId", entity.CurrentDistrictId);
                parameterlist.Add("@CurrentCityId", entity.CurrentCityId);
                parameterlist.Add("@CurrentPinCode", entity.CurrentPinCode);
                parameterlist.Add("@PermentAddress", entity.PermentAddress);
                parameterlist.Add("@PermentCountryId", entity.PermentCountryId);
                parameterlist.Add("@PermentStateId", entity.PermentStateId);
                parameterlist.Add("@PermentDistrictId", entity.PermentDistrictId);
                parameterlist.Add("@PermentCityId", entity.PermentCityId);
                parameterlist.Add("@PermentPinCode", entity.PermentPinCode);
                parameterlist.Add("@Status", entity.Status);
                parameterlist.Add("@Remark", entity.Remark);

                int effetedRows = CommanMethodsForSQL.ExecuteNonQueryProcedure("sp_StudentAddressDetailsInsert", parameterlist);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #30
0
        public IQueryable <HomePage> getClasswiseMaleFemaleList(int schoolId)
        {
            HomePage entity = new HomePage();

            entity.classList          = new List <String>();
            entity.classwiseBoysList  = new List <int>();
            entity.classwiseGirlsList = new List <int>();

            List <HomePage> entites = new List <HomePage>();

            try
            {
                String SqlQuery = "select class, countMale, CountFemale from view_ClassWiseMaleFemale";
                if (schoolId != 0)
                {
                    SqlQuery = SqlQuery + " where SchoolId=" + schoolId;
                }

                SqlQuery = SqlQuery + " order by LEN(Class), Class;";

                DataTable dataTable = CommanMethodsForSQL.GetDataTable(SqlQuery);
                if (dataTable != null && dataTable.Rows.Count > 0)
                {
                    foreach (DataRow dr in dataTable.Rows)
                    {
                        if (dr != null)
                        {
                            entity.classList.Add(Convert.ToString((dr["Class"])));
                            entity.classwiseBoysList.Add(Convert.ToInt32((dr["CountMale"])));
                            entity.classwiseGirlsList.Add(Convert.ToInt32((dr["CountFemale"])));
                            entites.Add(entity);
                        }
                    }
                }
                else
                {
                    entity.classList.Add("");
                    entity.classwiseBoysList.Add(0);
                    entity.classwiseGirlsList.Add(0);
                    entites.Add(entity);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(entites.AsQueryable());
        }