Пример #1
0
 internal List<MaintenancesModel> MaintenanceList(MaintenancesModel maintenance)
 {
     AddParameter("@communityid", maintenance.CommunityID);
     DataTable Dt_MaintenancesList = this.GetDataTable("usp_GetMaintenancesList");
     maintenancesList = new List<MaintenancesModel>();
     if (Dt_MaintenancesList.Rows.Count > 0)
     {
         foreach (DataRow dr in Dt_MaintenancesList.Rows)
         {
             maintenanceObj = new MaintenancesModel();
             maintenanceObj.MaintenanceID = Convert.ToInt64(dr["MaintenanceID"].ToString());
             maintenanceObj.CommunityID = Convert.ToInt16(dr["CommunityID"].ToString());
             maintenanceObj.Request = dr["Request"].ToString();
             maintenanceObj.Contact = dr["Contact"].ToString();
             maintenanceObj.EmailID = dr["EmailID"].ToString();
             maintenanceObj.CreatedUserID = Convert.ToInt64(dr["CreatedUserID"].ToString());
             maintenanceObj.CreatedRoleID = Convert.ToByte(dr["CreatedRoleID"].ToString());
             maintenanceObj.CreatedOn = Convert.ToDateTime(dr["CreatedOn"].ToString());
             if (!String.IsNullOrEmpty(dr["ModifiedOn"].ToString()))
             {
                 maintenanceObj.ModifiedUserID = Convert.ToInt64(dr["ModifiedUserID"].ToString());
                 maintenanceObj.ModifiedRoleID = Convert.ToByte(dr["ModifiedRoleID"].ToString());
                 maintenanceObj.ModifiedOn = Convert.ToDateTime(dr["ModifiedOn"].ToString());
             }
             maintenancesList.Add(maintenanceObj);
         }
     }
     return maintenancesList;
 }
Пример #2
0
        internal MaintenancesModel MaintenanceDetails(MaintenancesModel maintenance)
        {
            AddParameter("@maintenanceid", maintenance.MaintenanceID);
            DataTable Dt_MaintenanceDetails = this.GetDataTable("usp_GetMaintenanceDetails");

            if (Dt_MaintenanceDetails.Rows.Count > 0)
            {
                foreach (DataRow dr in Dt_MaintenanceDetails.Rows)
                {
                    maintenanceDetails = new MaintenancesModel();
                    maintenanceDetails.MaintenanceID = Convert.ToInt64(dr["MaintenanceID"].ToString());
                    maintenanceDetails.CommunityID = Convert.ToInt16(dr["CommunityID"].ToString());
                    maintenanceDetails.Request = dr["Request"].ToString();
                    maintenanceDetails.FullText = dr["FullText"].ToString();
                    maintenanceDetails.Contact = dr["Contact"].ToString();
                    maintenanceDetails.EmailID = dr["EmailID"].ToString();
                    maintenanceDetails.CreatedUserID = Convert.ToInt64(dr["CreatedUserID"].ToString());
                    maintenanceDetails.CreatedRoleID = Convert.ToByte(dr["CreatedRoleID"].ToString());
                    maintenanceDetails.CreatedOn = Convert.ToDateTime(dr["CreatedOn"].ToString());
                    if (!String.IsNullOrEmpty(dr["ModifiedOn"].ToString()))
                    {
                        maintenanceDetails.ModifiedUserID = Convert.ToInt64(dr["ModifiedUserID"].ToString());
                        maintenanceDetails.ModifiedRoleID = Convert.ToByte(dr["ModifiedRoleID"].ToString());
                        maintenanceDetails.ModifiedOn = Convert.ToDateTime(dr["ModifiedOn"].ToString());
                    }
                }
            }
            return maintenanceDetails;
        }
Пример #3
0
 internal Object DeleteMaintenance(MaintenancesModel maintenance)
 {
     AddParameter("@maintenanceid", maintenance.MaintenanceID);
     AddParameter("@modifieduserid", maintenance.ModifiedUserID);
     AddParameter("@modifiedroleid", maintenance.ModifiedRoleID);
     AddParameter("@modifiedon", maintenance.ModifiedOn);
     return ExecuteScalar("usp_DeleteMaintenance");
 }
Пример #4
0
        internal object AddMaintenance(MaintenancesModel maintenance)
        {
            AddParameter("@communityid", maintenance.CommunityID);
            AddParameter("@request", maintenance.Request);
            AddParameter("@fulltext", maintenance.FullText);
            AddParameter("@contact", maintenance.Contact);
            AddParameter("@emailid", maintenance.EmailID);
            AddParameter("@createduserid", maintenance.CreatedUserID);
            AddParameter("@createdroleid", maintenance.CreatedRoleID);
            AddParameter("@createdon", maintenance.CreatedOn);

            return this.ExecuteScalar("usp_AddMaintenance");
        }
 public ActionResult NewMaintenance(MaintenancesModel maintenance)
 {
     if (this.ModelState.IsValid)
     {
         maintenance.CreatedUserID = Convert.ToInt64(useMyCookie["UserID"].ToString());
         maintenance.CreatedRoleID = Convert.ToByte(useMyCookie["RoleID"].ToString());
         maintenance.CreatedOn = Convert.ToDateTime(DateTime.Now.ToShortDateString());
         return Json(maintenancesDAL.AddMaintenance(maintenance).ToString());
     }
     else
         return AjaxDataError("Maintenance");
 }
 public ActionResult NewMaintenance()
 {
     maintenance = new MaintenancesModel();
     maintenance.CommunityID = myCommunityID;
     return PartialView("Partials/Maintenances/NewMaintenance", maintenance);
 }
 public ActionResult MaintenancesListTable()
 {
     maintenance = new MaintenancesModel();
     maintenance.CommunityID = myCommunityID;
     return PartialView("Partials/Maintenances/MaintenancesListTable", maintenancesDAL.MaintenanceList(maintenance));
 }
        public ActionResult MaintenanceDetails(String maintenanceid)
        {
            if (MaintenanceIDSanctityCheck(maintenanceid))
            {
                maintenance = new MaintenancesModel();
                maintenance.CommunityID = myCommunityID;
                maintenance.MaintenanceID = Convert.ToInt64(maintenanceid.ToString());

                return PartialView("Partials/Maintenances/MaintenanceDetails", maintenancesDAL.MaintenanceDetails(maintenance));
            }
            else
                return AjaxParamError("Maintenance");
        }
Пример #9
0
 internal MaintenancesModel EditMaintenance(MaintenancesModel maintenance)
 {
     return this.MaintenanceDetails(maintenance);
 }
 public ActionResult MaintenancesListTable(String communityid)
 {
     if (CommunityIDSanctityCheck(communityid))
     {
         maintenance = new MaintenancesModel();
         maintenance.CommunityID = outCommunityID;
         return PartialView("Partials/Maintenances/MaintenancesListTable", maintenancesDAL.MaintenanceList(maintenance));
     }
     else
         return AjaxParamError("Community");
 }
        public ActionResult EditMaintenance(String maintenanceid, String communityid)
        {
            if (CommunityIDSanctityCheck(communityid))
            {
                if (MaintenanceIDSanctityCheck(maintenanceid))
                {
                    maintenance = new MaintenancesModel();
                    maintenance.CommunityID = outCommunityID;
                    maintenance.MaintenanceID = Convert.ToInt64(maintenanceid.ToString());

                    return PartialView("Partials/Maintenances/EditMaintenance", maintenancesDAL.EditMaintenance(maintenance));
                }
                else
                    return AjaxParamError("Maintenance");
            }
            else
                return AjaxParamError("Community");
        }
        public ActionResult UpdateMaintenance(MaintenancesModel maintenance)
        {
            if (ModelState.IsValid)
            {
                maintenance.ModifiedUserID = Convert.ToInt64(useMyCookie["UserID"].ToString());
                maintenance.ModifiedOn = Convert.ToDateTime(DateTime.Now.ToShortDateString());

                return Json(maintenancesDAL.UpdateMaintenance(maintenance));
            }
            else
                return AjaxDataError("Maitenance");
        }