示例#1
0
        public static T_CMS_Master_Internship UpdateItem(T_CMS_Master_Internship model)
        {
            int result = 0;

            using (var reader = SqlHelper.ExecuteReaderService(ModuleConfig.MyConnection, CommandType.StoredProcedure, "T_CMS_Master_Internship_Update", CreateSqlParameter(model)))
            {
                while (reader.Read())
                {
                    result = (int)reader[0];
                }
            }
            return(GetItemByID(result));
        }
示例#2
0
        /// <summary>

        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        private static SqlParameter[] CreateNewSqlParameter(T_CMS_Master_Internship model)
        {
            return(new SqlParameter[]
            {
                new SqlParameter("@Mode", "INTERN_INSERT"),
                //new SqlParameter("@ID", model.ID),
                new SqlParameter("@EmployeeCode", model.EmployeeCode),
                new SqlParameter("@IDCardNo", model.IDCardNo),
                new SqlParameter("@FirstName_EN", model.FirstName_EN),
                new SqlParameter("@MiddleName_EN", model.MiddleName_EN),
                new SqlParameter("@LastName_EN", model.LastName_EN),
                new SqlParameter("@FirstName_VN", model.FirstName_VN),
                new SqlParameter("@MiddleName_VN", model.MiddleName_VN),
                new SqlParameter("@LastName_VN", model.LastName_VN),
                new SqlParameter("@SalutationID", model.SalutationID),
                new SqlParameter("@DeptID", model.DeptID),
                new SqlParameter("@LocationID", model.LocationID),
                new SqlParameter("@WorkHours", model.WorkHours),
                new SqlParameter("@Grossoffer", model.Grossoffer),
                new SqlParameter("@PeriodofProbation", 60),
                new SqlParameter("@Joiningdate", model.Joiningdate),
                new SqlParameter("@Enddate", model.Enddate),
                new SqlParameter("@EmpTypeID", model.EmpTypeID),
                new SqlParameter("@EmpSubTypeID", model.EmpSubTypeID),
                new SqlParameter("@PassportNo", model.PassportNo),
                new SqlParameter("@UniversityID", model.UniversityID),
                new SqlParameter("@HousingAllowance", model.HousingAllowance),
                new SqlParameter("@PeriodofInternship", model.PeriodofInternship),
                new SqlParameter("@CreatedBy", model.CreatedBy),
                new SqlParameter("@Remarks", model.Remarks),
                //not need to insert

                //new SqlParameter("@InternNo", model.InternNo),
                //new SqlParameter("@StatusID", model.StatusID),
                //new SqlParameter("@ApproverLevel", model.ApproverLevel),
                //new SqlParameter("@InternLevel", model.InternLevel),



                //new SqlParameter("@Dept", model.Dept),



                //new SqlParameter("@Remarks", model.Remarks),
                //new SqlParameter("@IsActive", model.IsActive),

                //new SqlParameter("@CreatedDate", model.CreatedDate),
                //new SqlParameter("@ModifiedBy", model.ModifiedBy),
                //new SqlParameter("@ModifiedDate", model.ModifiedDate),
            });
        }
示例#3
0
        public static T_CMS_Master_InternshipCollection Search(SearchFilter SearchKey)
        {
            T_CMS_Master_InternshipCollection collection = new T_CMS_Master_InternshipCollection();

            using (var reader = SqlHelper.ExecuteReaderService(ModuleConfig.MyConnection, "T_CMS_Master_Internship_Search", SearchFilterManager.SqlSearchConditionNoCompany(SearchKey)))
            {
                while (reader.Read())
                {
                    T_CMS_Master_Internship obj = new T_CMS_Master_Internship();
                    obj = GetItemFromReader(reader);
                    collection.Add(obj);
                }
            }
            return(collection);
        }
示例#4
0
        public static T_CMS_Master_InternshipCollection GetAllItem()
        {
            T_CMS_Master_InternshipCollection collection = new T_CMS_Master_InternshipCollection();

            using (var reader = SqlHelper.ExecuteReaderService(ModuleConfig.MyConnection, "T_CMS_Master_Internship_GetAll", null))
            {
                while (reader.Read())
                {
                    T_CMS_Master_Internship obj = new T_CMS_Master_Internship();
                    obj = GetItemFromReader(reader);
                    collection.Add(obj);
                }
            }
            return(collection);
        }
示例#5
0
        public static T_CMS_Master_Internship GetItemByID(int ID)
        {
            T_CMS_Master_Internship item = new T_CMS_Master_Internship();
            var sqlParams = new SqlParameter[1];

            sqlParams[0] = new SqlParameter("@ID", ID);
            using (var reader = SqlHelper.ExecuteReaderService(ModuleConfig.MyConnection, "T_CMS_Master_Internship_GetByID", sqlParams))
            {
                while (reader.Read())
                {
                    item = GetItemFromReader(reader);
                }
            }
            return(item);
        }
示例#6
0
        private static T_CMS_Master_Internship GetItemFromReader(IDataReader dataReader)
        {
            T_CMS_Master_Internship objItem = new T_CMS_Master_Internship();

            objItem.ID = SqlHelper.GetInt(dataReader, "ID");

            objItem.EmployeeCode = SqlHelper.GetInt(dataReader, "EmployeeCode");

            objItem.InternNo = SqlHelper.GetString(dataReader, "InternNo");

            objItem.StatusID = SqlHelper.GetInt(dataReader, "StatusID");

            objItem.ApproverLevel = SqlHelper.GetInt(dataReader, "ApproverLevel");

            objItem.InternLevel = SqlHelper.GetInt(dataReader, "InternLevel");

            objItem.IDCardNo = SqlHelper.GetString(dataReader, "IDCardNo");

            objItem.PassportNo = SqlHelper.GetString(dataReader, "PassportNo");

            objItem.FirstName_EN = SqlHelper.GetString(dataReader, "FirstName_EN");

            objItem.MiddleName_EN = SqlHelper.GetString(dataReader, "MiddleName_EN");

            objItem.LastName_EN = SqlHelper.GetString(dataReader, "LastName_EN");

            objItem.FirstName_VN = SqlHelper.GetString(dataReader, "FirstName_VN");

            objItem.MiddleName_VN = SqlHelper.GetString(dataReader, "MiddleName_VN");

            objItem.LastName_VN = SqlHelper.GetString(dataReader, "LastName_VN");

            objItem.SalutationID = SqlHelper.GetInt(dataReader, "SalutationID");

            objItem.UniversityID = SqlHelper.GetInt(dataReader, "UniversityID");

            objItem.DeptID = SqlHelper.GetInt(dataReader, "DeptID");

            objItem.Dept = SqlHelper.GetString(dataReader, "Dept");

            objItem.LocationID = SqlHelper.GetInt(dataReader, "LocationID");

            objItem.WorkHours = SqlHelper.GetInt(dataReader, "WorkHours");

            objItem.Grossoffer = SqlHelper.GetDecimal(dataReader, "Grossoffer");

            objItem.HousingAllowance = SqlHelper.GetInt(dataReader, "HousingAllowance");

            objItem.PeriodofInternship = SqlHelper.GetInt(dataReader, "PeriodofInternship");

            objItem.Joiningdate = SqlHelper.GetDateTime(dataReader, "Joiningdate");

            objItem.Enddate = SqlHelper.GetDateTime(dataReader, "Enddate");

            objItem.EmpTypeID = SqlHelper.GetInt(dataReader, "EmpTypeID");

            objItem.EmpSubTypeID = SqlHelper.GetInt(dataReader, "EmpSubTypeID");

            objItem.Remarks = SqlHelper.GetString(dataReader, "Remarks");

            objItem.IsActive = SqlHelper.GetBoolean(dataReader, "IsActive");

            objItem.CreatedBy = SqlHelper.GetInt(dataReader, "CreatedBy");

            objItem.CreatedDate = SqlHelper.GetDateTime(dataReader, "CreatedDate");

            objItem.ModifiedBy = SqlHelper.GetInt(dataReader, "ModifiedBy");

            objItem.ModifiedDate = SqlHelper.GetDateTime(dataReader, "ModifiedDate");



            if (SqlHelper.ColumnExists(dataReader, "TotalRecord"))
            {
                objItem.TotalRecord = SqlHelper.GetInt(dataReader, "TotalRecord");
            }
            return(objItem);
        }