Esempio n. 1
0
        public bool UpdateBatchUserMap(List <System.Web.Mvc.SelectListItem> list, string batchID, string companyID, string loggedUserID)
        {
            var obj = new BatchUserMap();

            using (var db = ObjectFactory.CreateDbContext(commonService.GetCompanyDbFilePath(this.company)))
            {
                db.Execute(SQL.EmptyBatchUserMap, null);

                foreach (var item in list)
                {
                    obj                  = new BatchUserMap();
                    obj.ID               = Guid.NewGuid().ToString().ToLower();
                    obj.CompanyID        = companyID.ToLower();
                    obj.CreatedBy        = loggedUserID;
                    obj.CreationDate     = Utility.GetCurrentDateInt();
                    obj.CreationTime     = Utility.GetCurrentTimeInt();
                    obj.ModificationDate = Utility.GetCurrentDateInt();
                    obj.ModificationTime = Utility.GetCurrentTimeInt();
                    obj.ModifiedBy       = loggedUserID;
                    obj.BatchID          = batchID.ToLower();
                    obj.IsActive         = true;
                    obj.OtherDetails     = item.Text;
                    obj.UserID           = item.Value;

                    db.Execute(SQL.InsertBatchUserMap, obj);
                }
            }
            return(true);
        }
Esempio n. 2
0
 public BatchUserMap EditBatchUserMapping(BatchUserMap obj)
 {
     using (var db = ObjectFactory.CreateDbContext(commonService.GetCompanyDbFilePath(this.company)))
     {
         obj = db.GetQueryData <BatchUserMap>(SQL.UpdateBatchUserMap + "; " + SQL.SelectBatchUserMapByID, obj).FirstOrDefault();
     }
     return(obj);
 }
Esempio n. 3
0
 public ActionResult edit(BatchUserMap obj)
 {
     obj.CompanyID        = this.Company.ToLower();
     obj.ModificationDate = Utility.GetCurrentDateInt();
     obj.ModificationTime = Utility.GetCurrentTimeInt();
     obj.ModifiedBy       = LoggedUserID;
     _db.EditBatchUserMapping(obj);
     return(RedirectToAction("index"));
 }
Esempio n. 4
0
        public BatchUserMap GetBatchUserMapping(string id)
        {
            var data = new BatchUserMap();

            using (var db = ObjectFactory.CreateDbContext(commonService.GetCompanyDbFilePath(this.company)))
            {
                data = db.GetQueryData <BatchUserMap>(SQL.SelectBatchUserMapByID, new { ID = id }).FirstOrDefault();
            }
            return(data);
        }
Esempio n. 5
0
 public ActionResult add(BatchUserMap obj)
 {
     obj.ID               = Guid.NewGuid().ToString().ToLower();
     obj.CompanyID        = this.Company.ToLower();
     obj.CreatedBy        = LoggedUserID;
     obj.CreationDate     = Utility.GetCurrentDateInt();
     obj.CreationTime     = Utility.GetCurrentTimeInt();
     obj.ModificationDate = Utility.GetCurrentDateInt();
     obj.ModificationTime = Utility.GetCurrentTimeInt();
     obj.ModifiedBy       = LoggedUserID;
     _db.AddBatchUserMapping(obj);
     return(RedirectToAction("index"));
 }