示例#1
0
        public string BlockUnblockSlot(int slotID, bool chk)
        {
            string result    = "no";
            long   CompanyID = Convert.ToInt64(BaseUtil.GetSessionValue(AdminInfo.companyID.ToString()));

            var slotExists = db.slotsBlockeds.Where(e => e.SlotID == slotID && e.companyID == CompanyID).FirstOrDefault();

            if (slotExists == null)
            {
                slotsBlocked oslotsBlockeds = new slotsBlocked();
                oslotsBlockeds.companyID     = CompanyID;
                oslotsBlockeds.dataIsUpdated = BaseUtil.GetCurrentDateTime();
                oslotsBlockeds.EmployerID    = Convert.ToInt64(BaseUtil.GetSessionValue(AdminInfo.employerID.ToString()));
                oslotsBlockeds.isDeleted     = false;
                oslotsBlockeds.modifyBy      = Convert.ToInt64(BaseUtil.GetSessionValue(AdminInfo.employerID.ToString()));
                oslotsBlockeds.SlotID        = slotID;
                oslotsBlockeds.dataIsCreated = BaseUtil.GetCurrentDateTime();
                db.slotsBlockeds.Add(oslotsBlockeds);
                try
                {
                    db.SaveChanges();
                    result = "OK";
                    return(result);
                }
                catch (Exception ex)
                {
                    BaseUtil.CaptureErrorValues(ex);
                    return(result);
                }
            }
            else
            {
                slotExists.EmployerID = Convert.ToInt64(BaseUtil.GetSessionValue(AdminInfo.employerID.ToString()));
                if (chk)
                {
                    slotExists.isDeleted = false;
                }
                else
                {
                    slotExists.isDeleted = true;
                }
                slotExists.modifyBy        = Convert.ToInt64(BaseUtil.GetSessionValue(AdminInfo.employerID.ToString()));
                slotExists.dataIsCreated   = BaseUtil.GetCurrentDateTime();
                db.Entry(slotExists).State = EntityState.Modified;
                try
                {
                    db.SaveChanges();
                    result = "OK";
                    return(result);
                }
                catch (Exception ex)
                {
                    BaseUtil.CaptureErrorValues(ex);
                    return(result);
                }
            }
        }
示例#2
0
 public ActionResult Edit([Bind(Include = "companyID,companyName,cityID,address,website,companyIndustry,companyDescription,gstNo,tinNo,ctsNo,logo,createdDate,isActive,isDeleted,modifiedBy,modifiedDate,employerTypeID")] companyDetail companyDetail)
 {
     try {
         if (ModelState.IsValid)
         {
             db.Entry(companyDetail).State = EntityState.Modified;
             db.SaveChanges();
             return(RedirectToAction("Index"));
         }
     }
     catch (Exception e)
     {
         BaseUtil.CaptureErrorValues(e);
     }
     //ViewBag.cityID = new SelectList(db.cities, "cityID", "city1", companyDetail.cityID);
     ViewBag.modifiedBy     = new SelectList(db.EmployerDetails, "EmployerID", "Name", companyDetail.modifiedBy);
     ViewBag.employerTypeID = new SelectList(db.employerTypes, "employerTypeID", "employerType1", companyDetail.employerTypeID);
     return(View(companyDetail));
 }
 public ActionResult review(jobDetail ojobDetail)
 {
     ojobDetail = db.jobDetails.Where(m => m.jobID == ojobDetail.jobID).FirstOrDefault();
     if (ojobDetail == null)
     {
         return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
     }
     ojobDetail.isActive        = true;
     ojobDetail.compeletPosted  = true;
     ojobDetail.jobStatusID     = 1;
     db.Entry(ojobDetail).State = EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Confirm"));
 }
示例#4
0
 public ActionResult _Employerlogin(string qenid)
 {
     try
     {
         if (qenid != null)
         {
             var decryptValue = BaseUtil.Decrypt(qenid);
             int ID           = Convert.ToInt32(decryptValue);
             ViewBag.qenid = ID != null ? ID : 0;
             //login ologin = new login();
             var result = db.EmployerDetails.Where(e => e.EmployerID == ID).FirstOrDefault();
             result.isActive        = true;
             result.dataIsUpdated   = BaseUtil.GetCurrentDateTime();
             db.Entry(result).State = System.Data.Entity.EntityState.Modified;
             db.SaveChanges();
             TempData["result"] = "Activated";
             // return View("_partialEmploerLogin");
             return(RedirectToAction("Employerlogin"));
         }
         else
         {
             int ID = Convert.ToInt32(qenid);
             ViewBag.qenid = ID != null ? ID : 0;
             return(View("_partialEmploerLogin"));
         }
     }
     catch (Exception ex)
     {
         BaseUtil.CaptureErrorValues(ex);
     }
     return(View("_partialEmploerLogin"));
 }
示例#5
0
 public void Commit()
 {
     _db.SaveChanges();
     _transaction.Complete();
 }