Beispiel #1
0
        public long Save(CourseTestAnswerModel model)
        {
            Course_Test_Answer _tbl_courseTest = new Course_Test_Answer(model);

            if (model.Id != null && model.Id != 0)
            {
                _CourseTestAnswer.Update(_tbl_courseTest);
            }
            else
            {
                _CourseTestAnswer.Insert(_tbl_courseTest);
            }

            return(_tbl_courseTest.Id);
        }
        public int Save(ExistingMadarsaOperationsRequestModel model)
        {
            ExistingMadarsaOperationsRequest _tblList = new ExistingMadarsaOperationsRequest(model);

            _RequestSubmitModel.ShortDesc     = model.ShortDescription;
            _RequestSubmitModel.UserId        = model.UserId;
            _RequestSubmitModel.CreatedDate   = Convert.ToDateTime(System.DateTime.Now);
            _RequestSubmitModel.RequestTypeId = model.RequestTypeId;
            RequestSubmit _requestSubmit = new RequestSubmit(_RequestSubmitModel);

            if (_tblList.Id != null && _tblList.Id != 0)
            {
                _tblList.CreatedDate = Convert.ToDateTime(System.DateTime.Now);
                tbl_ExistingMadarsaOperationsRequestModel.Update(_tblList);
            }
            else
            {
                _requestSubmit           = _RequestSubmit.Insert(_requestSubmit);
                _tblList.RequestSubmitId = _requestSubmit.Id;
                _tblList.CreatedDate     = Convert.ToDateTime(System.DateTime.Now);
                _tblList = tbl_ExistingMadarsaOperationsRequestModel.Insert(_tblList);
            }


            return(_tblList.Id);
        }
Beispiel #3
0
        public int Save(EventRequestModel model)
        {
            EventRequest _eventRequest = new EventRequest(model);

            if (model.Id != null && model.Id != 0)
            {
                _EventRequest.Update(_eventRequest);
            }
            else
            {
                RequestSubmitModel res = new RequestSubmitModel();
                res.RequestTypeId = 9;
                res.UserId        = model.UserId;
                res.ShortDesc     = model.Description;

                int id = new RequestSubmitBs().Save(res);
                _eventRequest.RequestSubmitId = id;
                _eventRequest.Poster          = model.Poster;
                _eventRequest.CreatedDate     = System.DateTime.Now;
                _eventRequest.RequestTypeId   = 9;
                _EventRequest.Insert(_eventRequest);
            }

            return(_eventRequest.Id);
        }
Beispiel #4
0
        public int Save(MasjidLandRequestModel model)
        {
            MasjidLandRequest _tbl_mlr = new MasjidLandRequest(model);

            _RequestSubmitModel.ShortDesc     = model.ShortDescription;
            _RequestSubmitModel.UserId        = model.UserId;
            _RequestSubmitModel.CreatedDate   = Convert.ToDateTime(System.DateTime.Now);
            _RequestSubmitModel.RequestTypeId = model.RequestTypeId;
            RequestSubmit _requestSubmit = new RequestSubmit(_RequestSubmitModel);

            if (_tbl_mlr.Id != null && _tbl_mlr.Id != 0)
            {
                _tbl_mlr.CreatedDate = Convert.ToDateTime(System.DateTime.Now);
                //_tblList.CreatedBy = 1;
                _tbl_MLR.Update(_tbl_mlr);
            }
            else
            {
                _requestSubmit           = _RequestSubmit.Insert(_requestSubmit);
                _tbl_mlr.RequestSubmitId = _requestSubmit.Id;
                _tbl_mlr.CreatedDate     = Convert.ToDateTime(System.DateTime.Now);
                //_tblList.CreatedBy = 1;
                _tbl_mlr = _tbl_MLR.Insert(_tbl_mlr);
            }


            return(_tbl_mlr.Id);
        }
Beispiel #5
0
        public void UpdateCategory(List <CategoryModel> lstmodel, int userid)
        {
            lstmodel.ForEach(x =>
            {
                var userCategory = _userCategoryMapping.GetWithInclude(z => z.UserID == userid && z.CategoryID == x.Id).FirstOrDefault();

                if (userCategory != null)
                {
                    userCategory.IsSelected = x.IsChecked;
                    _userCategoryMapping.Update(userCategory);
                }
                else
                {
                    UserCategoryMapping catergorymap = new UserCategoryMapping();
                    catergorymap.UserID     = userid;
                    catergorymap.CategoryID = x.Id;
                    catergorymap.IsSelected = x.IsChecked;
                    _userCategoryMapping.Insert(catergorymap);
                }
            });
            return;
        }
Beispiel #6
0
        public bool AddUserList(UserGroupModel model)
        {
            using (var scope = new TransactionScope())
            {
                var userGroups = _userGroupMap.GetWithInclude(x => x.UserGroupID == model.UserGroupID).ToList();
                if (model.UserCheckList.Count == 0)
                {
                    userGroups.ForEach(x =>
                    {
                        _userGroupMap.Delete(Convert.ToInt32(x.Id));
                    });
                    scope.Complete();
                    return(true);
                }


                var userGroupList = userGroups.Select(x => x.UserID.Value).ToList();
                var addedList     = model.UserCheckList.Except(userGroupList).ToList();
                var deleteList    = userGroupList.Except(model.UserCheckList).ToList();
                var usergroupMap  = userGroups.Where(x => deleteList.Contains(x.UserID.Value)).Select(x => x.Id).ToList();
                usergroupMap.ForEach(x =>
                {
                    _userGroupMap.Delete(Convert.ToInt32(x));
                });

                addedList.ForEach(x =>
                {
                    UserGroup_Mapping usermap = new UserGroup_Mapping();
                    usermap.UserGroupID       = model.UserGroupID;
                    usermap.UserID            = x;
                    usermap.IsActive          = true;
                    usermap.CreatedOn         = DateTime.Now;
                    _userGroupMap.Insert(usermap);
                });
                scope.Complete();
            }
            return(true);
        }
        public int SaveProduct(ProductModel model)
        {
            Product _product = new Product(model);

            if (model.ID != 0 && model.ID != null)
            {
                _Product.Upate(_product);
            }
            else
            {
                _product = _Product.Insert(_product);
            }

            return(_product.ID);
        }
Beispiel #8
0
        public int SaveCategory(CategoryModel model)
        {
            Category _category = new Category(model);

            if (model.CategoryId != 0 && model.CategoryId != null)
            {
                _Category.Upate(_category);
            }
            else
            {
                _category = _Category.Insert(_category);
            }

            return(_category.ID);
        }
Beispiel #9
0
        public long Save(CourseTestModel model)
        {
            Course_Test _tbl_course = new Course_Test(model);

            if (model.Id != null && model.Id != 0)
            {
                _CourseTest.Update(_tbl_course);
            }
            else
            {
                _CourseTest.Insert(_tbl_course);
            }

            return(_tbl_course.Id);
        }
Beispiel #10
0
        public int Save(UserCategoryMappingModel model)
        {
            UserCategoryMapping _tbl_usercategory = new UserCategoryMapping(model);

            if (model.Id != null && model.Id != 0)
            {
                _userCategory.Update(_tbl_usercategory);
            }
            else
            {
                _userCategory.Insert(_tbl_usercategory);
            }

            return(_tbl_usercategory.ID);
        }
Beispiel #11
0
        public int Save(ZoneModel model)
        {
            Zone _tblZone = new Zone(model);

            if (model.Id != null && model.Id != 0)
            {
                _tbl_Zone.Update(_tblZone);
            }
            else
            {
                _tblZone = _tbl_Zone.Insert(_tblZone);
            }

            return(_tblZone.Id);
        }
Beispiel #12
0
        public int SaveCustomer(CustomerModel model)
        {
            Customer _customer = new Customer(model);

            if (model.ID != 0 && model.ID != null)
            {
                _Customer.Upate(_customer);
            }
            else
            {
                _customer = _Customer.Insert(_customer);
            }

            return(_customer.ID);
        }
Beispiel #13
0
        public int Save(MasjidModel model)
        {
            Masjid _tbl_masjid = new Masjid(model);

            if (model.Id != null && model.Id != 0)
            {
                _tbl_Masjid.Update(_tbl_masjid);
            }
            else
            {
                _tbl_masjid.CreatedDate = System.DateTime.Now;
                _tbl_Masjid.Insert(_tbl_masjid);
            }

            return(_tbl_masjid.Id);
        }
Beispiel #14
0
        public int Save(PanelInvolvementModel model)
        {
            PanelInvolvement _panelInvolvement = new PanelInvolvement(model);

            if (model.Id != null && model.Id != 0)
            {
                _PanelInvolvement.Update(_panelInvolvement);
            }
            else
            {
                _panelInvolvement.CreatedDate = Convert.ToDateTime(System.DateTime.Now);
                _PanelInvolvement.Insert(_panelInvolvement);
            }

            return(_panelInvolvement.Id);
        }
Beispiel #15
0
        public long Save(CourseSessionModel model)
        {
            CourseSession _tbl_courseSession = new CourseSession(model);

            if (model.Id != null && model.Id != 0)
            {
                _CourseSession.Update(_tbl_courseSession);
            }
            else
            {
                _tbl_courseSession.CreatedOn = System.DateTime.Now;
                _CourseSession.Insert(_tbl_courseSession);
            }

            return(_tbl_courseSession.Id);
        }
Beispiel #16
0
        public int Save(VolunteerModel model)
        {
            Volunteer _volunteer = new Volunteer(model);

            if (model.Id != null && model.Id != 0)
            {
                _Volunteer.Update(_volunteer);
            }
            else
            {
                _volunteer.CreatedDate = System.DateTime.Now;
                _Volunteer.Insert(_volunteer);
            }

            return(_volunteer.Id);
        }
Beispiel #17
0
        public int AmeerComment(RequestSubmitModel model)
        {
            RequestSubmit _requestComment = new RequestSubmit(model);

            if (model.Id != null && model.Id != 0)
            {
                _RequestSubmit.Update(_requestComment);
            }
            else
            {
                //  _requestApprove.CreatedDate = System.DateTime.Now;

                _requestComment = _RequestSubmit.Insert(_requestComment);
            }

            return(_requestComment.Id);
        }
Beispiel #18
0
        public int SaveEventDetails(EventRequestDetailModel model)
        {
            EventRequestDetail _eventRequestDetails = new EventRequestDetail(model);

            if (model.Id != null && model.Id != 0)
            {
                _EventRequestDetail.Update(_eventRequestDetails);
            }
            else
            {
                //_eventRequest.IsDelete = false;
                _eventRequestDetails.CreatedDate = System.DateTime.Now;
                _EventRequestDetail.Insert(_eventRequestDetails);
            }

            return(_eventRequestDetails.Id);
        }
Beispiel #19
0
        public int Save(CategoryModel model)
        {
            Category _tbl_category = new Category(model);

            if (model.Id != null && model.Id != 0)
            {
                _Category.Update(_tbl_category);
            }
            else
            {
                _tbl_category.IsDelete    = false;
                _tbl_category.CreatedDate = System.DateTime.Now;
                _Category.Insert(_tbl_category);
            }

            return(_tbl_category.Id);
        }
Beispiel #20
0
        public long Save(CourseModel model)
        {
            Course _tbl_course = new Course(model);

            if (model.Id != null && model.Id != 0)
            {
                _Course.Update(_tbl_course);
            }
            else
            {
                _tbl_course.IsDelete  = false;
                _tbl_course.CreatedOn = System.DateTime.Now;
                _Course.Insert(_tbl_course);
            }

            return(_tbl_course.Id);
        }
        public int Save(RequestApproveModel model)
        {
            RequestApprove _requestApprove = new RequestApprove(model);

            if (model.Id != null && model.Id != 0)
            {
                _RequestApprove.Update(_requestApprove);
            }
            else
            {
                //  _requestApprove.CreatedDate = System.DateTime.Now;

                _requestApprove = _RequestApprove.Insert(_requestApprove);
            }

            return(_requestApprove.Id);
        }
        public int SaveMasjidCommittee(AddMasjidCommittee model)
        {
            tbl_AddMasjidCommittee _tbl_addMasjidCommittee = new tbl_AddMasjidCommittee(model);

            if (model.Id != null && model.Id != 0)
            {
                _tbl_addMasjidCommittee.Status = true;
                _tbl_AddMasjidCommittee.Update(_tbl_addMasjidCommittee);
            }
            else
            {
                _tbl_addMasjidCommittee.CreatedBy   = 1;
                _tbl_addMasjidCommittee.CreatedDate = System.DateTime.Now;
                _tbl_addMasjidCommittee.Status      = true;
                _tbl_addMasjidCommittee             = _tbl_AddMasjidCommittee.Insert(_tbl_addMasjidCommittee);
            }

            return(_tbl_addMasjidCommittee.Id);
        }
Beispiel #23
0
        public long Save(UserGroupModel model)
        {
            UserGroup _tbl_userGroup = new UserGroup(model);

            if (model.Id != null && model.Id != 0)
            {
                _tbl_userGroup.UpdatedOn = System.DateTime.Now;
                _tbl_userGroup.IsActive  = true;
                _userGroup.Update(_tbl_userGroup);
            }
            else
            {
                _tbl_userGroup.IsActive  = true;
                _tbl_userGroup.CreatedOn = System.DateTime.Now;
                _userGroup.Insert(_tbl_userGroup);
            }

            return(_tbl_userGroup.Id);
        }
        public int SaveMadarsa(AddMadarsa model)
        {
            tbl_AddMadarsa _tbl_addMadarsa = new tbl_AddMadarsa(model);

            if (model.Id != null && model.Id != 0)
            {
                _tbl_addMadarsa.Status = true;
                _tbl_AddMadarsa.Update(_tbl_addMadarsa);
            }
            else
            {
                _tbl_addMadarsa.CreatedDate = System.DateTime.Now;
                _tbl_addMadarsa.CreatedBy   = 1;
                _tbl_addMadarsa.Status      = true;
                _tbl_addMadarsa             = _tbl_AddMadarsa.Insert(_tbl_addMadarsa);
            }

            return(_tbl_addMadarsa.Id);
        }
Beispiel #25
0
        public int SaveMasjidCommitteeMember(AddMasjidCommitteeMember model)
        {
            tbl_AddMasjidCommitteeMember _tbl_addMasjidCommitteeMember = new tbl_AddMasjidCommitteeMember(model);

            if (model.Id != null && model.Id != 0)
            {
                _tbl_addMasjidCommitteeMember.Status = true;
                _tbl_AddMasjidCommitteeMember.Update(_tbl_addMasjidCommitteeMember);
            }
            else
            {
                _tbl_addMasjidCommitteeMember.CreatedBy  = 1;
                _tbl_addMasjidCommitteeMember.CreateDate = System.DateTime.Now;
                _tbl_addMasjidCommitteeMember.Status     = true;
                _tbl_addMasjidCommitteeMember            = _tbl_AddMasjidCommitteeMember.Insert(_tbl_addMasjidCommitteeMember);
            }

            return(_tbl_addMasjidCommitteeMember.Id);
        }
Beispiel #26
0
        public int Save(RequestSubmitModel model)
        {
            RequestSubmit requestSubmit = new RequestSubmit(model);
            int           id            = model.Id;
            var           res           = _RequestSubmit.GetById(id);

            //  res.IsApproved = model.IsApproved;
            // res.CreatedDate = Convert.ToDateTime(System.DateTime.Now);
            if (model.Id != null && model.Id != 0)
            {
                _RequestSubmit.Update(res);
            }
            else
            {
                requestSubmit = _RequestSubmit.Insert(requestSubmit);
            }

            return(requestSubmit.Id);
        }
        public int Save(NewMadarsaOperation model)
        {
            tbl_NewMadarsaOperations _tbl_EMO_LocalVar = new tbl_NewMadarsaOperations(model);

            if (model.Id != null && model.Id != 0)
            {
                _tbl_EMO_LocalVar.Status = true;
                _tbl_NewMadarsaOperations.Update(_tbl_EMO_LocalVar);
            }
            else
            {
                _tbl_EMO_LocalVar.CreateDate = System.DateTime.Now;
                _tbl_EMO_LocalVar.CreatedBy  = 1;
                _tbl_EMO_LocalVar.Status     = true;
                _tbl_EMO_LocalVar            = _tbl_NewMadarsaOperations.Insert(_tbl_EMO_LocalVar);
            }

            return(_tbl_EMO_LocalVar.Id);
        }
Beispiel #28
0
        public int Save(UserModel model)
        {
            model.RoleId     = 4;
            model.UserTypeId = 9;
            User _UserModel = new User(model);

            if (model.Id != null && model.Id != 0)
            {
                tbl_UserRegistration.Update(_UserModel);
            }
            else
            {
                // tbl_UserRegistration.CreatedDate = System.DateTime.Now;

                tbl_UserRegistration.Insert(_UserModel);
            }

            return(_UserModel.Id);
        }
Beispiel #29
0
        public int SaveMasjidRenovation(MasjidRenovation model)
        {
            tbl_MasjidRenovation _MasjidReno_localVar = new tbl_MasjidRenovation(model);

            if (model.Id != null && model.Id != 0)
            {
                _MasjidReno_localVar.Status = true;
                _tbl_MasjidRenovation.Update(_MasjidReno_localVar);
            }
            else
            {
                _MasjidReno_localVar.CreatedDate = System.DateTime.Now;
                _MasjidReno_localVar.CreatedBy   = 1;
                _MasjidReno_localVar.Status      = true;
                _MasjidReno_localVar             = _tbl_MasjidRenovation.Insert(_MasjidReno_localVar);
            }

            return(_MasjidReno_localVar.Id);
        }
        public int SaveMasjid(AddMasjid model)
        {
            tbl_AddMasjid _tbl_addmasjid = new tbl_AddMasjid(model);

            if (model.Id != null && model.Id != 0)
            {
                _tbl_addmasjid.Status = true;
                _tbl_AddMasjid.Update(_tbl_addmasjid);
            }
            else
            {
                _tbl_addmasjid.CreatedBy   = 1;
                _tbl_addmasjid.CreatedDate = System.DateTime.Now;
                _tbl_addmasjid.Status      = true;
                _tbl_addmasjid             = _tbl_AddMasjid.Insert(_tbl_addmasjid);
            }

            return(_tbl_addmasjid.Id);
        }