public async Task <ActionResult> Edit([Bind(Include = "Id,Name,Description,CertificationType,DateAchieved,Skilled,StaffId,CreatedBy,CreatedOn,ModeifiedBy,ModifiedOn")] Certification certification)
        {
            if (ModelState.IsValid)
            {
                var user = User.Identity.Name;
                certification.ModeifiedBy = user;
                certification.ModifiedOn  = DateTime.Today;
                certification.StaffId     = LegalGuideUtility.StaffId; //(string)ViewBag.StaffId;

                db.Entry(certification).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Create", "Dependants"));
            }
            //ViewBag.StaffId = new SelectList(db.Staffs, "StaffId", "FirstName", certification.StaffId);
            ViewBag.Skilled = new List <SelectListItem>
            {
                new SelectListItem {
                    Text = "Advanced", Value = "Advanced"
                },
                new SelectListItem {
                    Text = "Beginner", Value = "Beginner"
                },
                new SelectListItem {
                    Text = "Intermediate", Value = "Intermediate"
                },
                new SelectListItem {
                    Text = "Novice", Value = "Novice"
                },
                new SelectListItem {
                    Text = "Expert", Value = "Expert"
                }
            };
            return(View(certification));
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> Edit([Bind(Include = "Id,MatterNumber,DateHeared,CourtName,Location,StaffId,Status,AdvocateArgument,OpponentArgument,AdvocateNote,CreatedBy,CreatedOn,ModifiedBy,ModifiedOn,DateAdjourned,DefenseCounselName")] CourtActivity courtActivity)
        {
            if (ModelState.IsValid)
            {
                var user    = User.Identity.Name;
                var email   = LegalGuideUtility.GetStaffEmailByLoginName(user);
                var staffId = LegalGuideUtility.GetStaffIdByEmail(email);
                //courtActivity.CreatedBy
                courtActivity.ModifiedBy = user;
                courtActivity.ModifiedOn = DateTime.Today;
                courtActivity.StaffId    = staffId;

                db.Entry(courtActivity).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.Status = new List <SelectListItem> {
                new SelectListItem {
                    Value = "Adjourned", Text = "Adjourned"
                },
                new SelectListItem {
                    Value = "Dismissed", Text = "Dismissed"
                },
                new SelectListItem {
                    Value = "Judgement Delivered", Text = "Judgement Delivered"
                },
                new SelectListItem {
                    Value = "Strike Out", Text = "Strike Out"
                }
            };

            return(View(courtActivity));
        }
Ejemplo n.º 3
0
        public async Task <ActionResult> Edit([Bind(Include = "LineManagerId,Name,Department,Designation,CreatedBy,CreatedOn,ModifiedBy,ModifiedOn")] LineManager lineManager)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var user = User.Identity;
                    lineManager.ModifiedBy = user.Name;
                    lineManager.ModifiedOn = DateTime.Today;

                    db.Entry(lineManager).State = EntityState.Modified;
                    await db.SaveChangesAsync();

                    return(RedirectToAction("Index"));
                }
                else
                {
                    ViewBag.Error = "Can't add Document. Fill in the required Fields. ";
                    return(View(lineManager));
                }
            }
            catch (Exception ex)
            {
                ViewBag.Error = "Can't add Line Manager. Fill in the required Fields. " + ex.Message;
            }
            return(View(lineManager));
        }
Ejemplo n.º 4
0
        public async Task <ActionResult> Edit([Bind(Include = "Id,Title,From,To,MatterNumber,StaffId,Locations,Priority,MeetingType,CreatedBy,CreatedOn,ModifiedBy,ModifiedOn")] Calendar calendar)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    var user = User.Identity.Name;
                    calendar.ModifiedBy      = user;
                    calendar.ModifiedOn      = DateTime.Today;
                    db.Entry(calendar).State = EntityState.Modified;
                    await db.SaveChangesAsync();

                    return(RedirectToAction("Index"));
                }
                catch (Exception)
                {
                    ViewBag.Error = "Can't Add Calendar, Error Occured. Please Contact IT Department.";
                }
            }
            else
            {
                ViewBag.Error  = "Fill in the required fields to continue";
                ViewBag.Matter = new SelectList(db.GetAllMattersForDropDown(), "Id", "Subject");
                ViewBag.Staff  = new SelectList(db.GetAllStaffForDropDown(), "StaffId", "StaffName");
                return(View(calendar));
            }
            ViewBag.Matter = new SelectList(db.GetAllMattersForDropDown(), "Id", "Subject");
            ViewBag.Staff  = new SelectList(db.GetAllStaffForDropDown(), "StaffId", "StaffName");
            return(View(calendar));
        }
Ejemplo n.º 5
0
        public async Task <ActionResult> Edit([Bind(Include = "Id,FirstName,LastName,PolicyNumber,EffectiveDate,EndDate,Gender,Relationship,DateOfBirth,Description,Address,StaffId,CreatedBy,CreatedOn,ModifiedBy,ModifiedOn")] Dependant dependant)
        {
            if (ModelState.IsValid)
            {
                var user = User.Identity.Name;
                dependant.ModifiedBy = user;
                dependant.ModifiedOn = DateTime.Today;
                dependant.StaffId    = LegalGuideUtility.StaffId;

                db.Entry(dependant).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            var gender = new List <SelectListItem> {
                new SelectListItem {
                    Text = "Male", Value = "M"
                },
                new SelectListItem {
                    Text = "Female", Value = "F"
                }
            };

            ViewBag.Gender = gender;
            //ViewBag.StaffId = new SelectList(db.Staffs, "StaffId", "FirstName", dependant.StaffId);
            return(View(dependant));
        }
Ejemplo n.º 6
0
        public async Task <ActionResult> Edit([Bind(Include = "Id,TaskType,Description,MatterNumber,NotifyDays,CreatedBy,CreatedOn,ModifiedBy,ModifiedOn,Priority,Reporter,Assignee,DueDate")] LMSTask lMSTask)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    var user = User.Identity.Name;
                    lMSTask.ModifiedBy = user;
                    lMSTask.ModifiedOn = DateTime.Today;

                    db.Entry(lMSTask).State = EntityState.Modified;
                    await db.SaveChangesAsync();

                    return(RedirectToAction("Index"));
                }
                catch (Exception)
                {
                    ViewBag.Error = "Can't Add Task, Error Occured. Please Contact IT Department.";
                }
            }
            else
            {
                ViewBag.Error    = "Fill in the required fields to continue";
                ViewBag.Matter   = new SelectList(db.GetAllMattersForDropDown(), "Id", "Subject");
                ViewBag.Staff    = new SelectList(db.GetAllStaffForDropDown(), "StaffId", "StaffName");
                ViewBag.Priority = new List <SelectListItem> {
                    new SelectListItem {
                        Value = "Critical", Text = "Critical"
                    },
                    new SelectListItem {
                        Value = "High", Text = "High"
                    },
                    new SelectListItem {
                        Value = "Medium", Text = "Medium"
                    },
                    new SelectListItem {
                        Value = "Low", Text = "Low"
                    }
                };
                return(View(lMSTask));
            }
            ViewBag.Matter   = new SelectList(db.GetAllMattersForDropDown(), "Id", "Subject");
            ViewBag.Staff    = new SelectList(db.GetAllStaffForDropDown(), "StaffId", "StaffName");
            ViewBag.Priority = new List <SelectListItem> {
                new SelectListItem {
                    Value = "Critical", Text = "Critical"
                },
                new SelectListItem {
                    Value = "High", Text = "High"
                },
                new SelectListItem {
                    Value = "Medium", Text = "Medium"
                },
                new SelectListItem {
                    Value = "Low", Text = "Low"
                }
            };
            return(View(lMSTask));
        }
Ejemplo n.º 7
0
        public async Task <ActionResult> Edit([Bind(Include = "Id,GroupName,Description,CreatedBy,CreatedOn,ModifiedBy,ModifiedOn")] AdvocateGroup advocateGroup)
        {
            if (ModelState.IsValid)
            {
                db.Entry(advocateGroup).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(advocateGroup));
        }
Ejemplo n.º 8
0
 public async Task<ActionResult> Edit([Bind(Include = "ClientId,FirstName,MiddleName,LastName,EmailAddress,PhoneNumber,Address,Town,PostalCode,Website,CreatedBy,CreatedOn,ModifiedBy,ModifiedOn")] Client client)
 {
     if (ModelState.IsValid)
     {
         var user = User.Identity;
         client.ModifiedBy = user.Name;
         client.ModifiedOn = DateTime.Today.Date;
         db.Entry(client).State = EntityState.Modified;
         await db.SaveChangesAsync();
         return RedirectToAction("Index");
     }
     return View(client);
 }
Ejemplo n.º 9
0
        public async Task <ActionResult> Edit([Bind(Include = "StaffId,Surname,OtherNames,Gender,CreatedBy,CreatedOn,ModifiedBy,ModifiedOn,Type,DOB,DOE,Status,Address,PostalCode,Town,OfficeNo,MobileNo,EmailAddress,NextOfKin,Relationship,KTelephone,NHISNumber,KRA,Bank,Branch,AccountNumber,SecretCode,Password")] Staff staff)
        {
            if (ModelState.IsValid)
            {
                var user = User.Identity;
                staff.ModifiedBy      = user.Name;
                staff.ModifiedOn      = DateTime.Today.Date;
                db.Entry(staff).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(staff));
        }
Ejemplo n.º 10
0
        public async Task <ActionResult> Edit([Bind(Include = "Id,FileNumber,StaffId,StartDate,EndDate,Location,EventName,Address,Description,Completed,CreatedBy,CreatedOn,ModifiedBy,ModifiedOn")] FileEvent fileEvent)
        {
            if (ModelState.IsValid)
            {
                var user = User.Identity.Name;
                fileEvent.ModifiedBy = user;
                fileEvent.ModifiedOn = DateTime.Today;

                db.Entry(fileEvent).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            //ViewBag.FileNumber = new SelectList(db.Files, "FileNumber", "FileName", fileEvent.FileNumber);
            ViewBag.StaffId = new SelectList(db.Staffs, "StaffId", "FirstName", fileEvent.StaffId);
            return(View(fileEvent));
        }
        public async Task <ActionResult> Edit([Bind(Include = "Id,ClientName,SoftwareVersion,ApprovedKey,ValidityFrom,ValidityTo,ApprovedDocument,ApprovedBy,CreatedBy,CreatedOn,ModifiedBy,ModifiedOn")] LicenseTable licenseTable, HttpPostedFileBase file)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    string fileName = string.Empty;
                    string filePath = string.Empty;

                    if (file.ContentLength > 0 && file != null)
                    {
                        filePath = file.FileName;
                        fileName = Path.GetFileName(file.FileName);
                    }
                    else
                    {
                        ViewBag.Error = " please select approved document to continue.";
                        return(View(licenseTable));
                    }
                    var folderPath   = AppDomain.CurrentDomain.BaseDirectory + "/App_Data/LicenseDocs";
                    var fullFilePath = Path.Combine(folderPath, filePath);

                    licenseTable.ApprovedDocument = fileName;
                    licenseTable.ModifiedBy       = User.Identity.Name;
                    licenseTable.ModifiedOn       = DateTime.Today;
                    licenseTable.IsExpired        = false;
                    licenseTable.IsLicensed       = true;
                    licenseTable.ApprovedKey      = LegalGuideUtility.Encrypt(licenseTable.ApprovedKey);
                    licenseTable.SoftwareVersion  = licenseTable.SoftwareVersion.ToString();
                    db.Entry(licenseTable).State  = EntityState.Modified;
                    await db.SaveChangesAsync();

                    return(RedirectToAction("Index"));
                }
                catch (Exception ex)
                {
                    ViewBag.Error = "Can't Save License info please check and try again." + ex.Message;
                }
            }
            else
            {
                ViewBag.Error = "Can't Save License info, Some fields are missing";
                return(View(licenseTable));
            }
            return(View(licenseTable));
        }
Ejemplo n.º 12
0
        public async Task <ActionResult> Edit([Bind(Include = "Id,Employer,Designation,StartDate,EndDate,Description,Salary,StaffId,CreatedOn,CreatedBy,ModifiedBy,ModifiedOn")] Experience experience)
        {
            if (ModelState.IsValid)
            {
                var user = User.Identity.Name;
                experience.ModifiedBy = user;
                experience.ModifiedOn = DateTime.Today;
                experience.StaffId    = LegalGuideUtility.StaffId;

                db.Entry(experience).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Create", "Educations"));
            }
            //ViewBag.StaffId = new SelectList(db.Staffs, "StaffId", "FirstName", experience.StaffId);
            return(View(experience));
        }
Ejemplo n.º 13
0
        public async Task <ActionResult> Edit([Bind(Include = "DocumentId,MatterNumber,DocName,AssignedDate,Tags,Description,CreatedBy,DateCreated,ModifiedBy,DateModified,DocPath")] Document document, HttpPostedFileBase fileBase)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    string fileName = string.Empty;
                    string filePath = string.Empty;

                    if (fileBase.ContentLength > 0 && fileBase != null)
                    {
                        filePath = fileBase.FileName;
                        fileName = Path.GetFileName(fileBase.FileName);
                    }
                    var folderPath = AppDomain.CurrentDomain.BaseDirectory + "/App_Data/Docs";
                    var docPath    = Path.Combine(folderPath, filePath);

                    var user = User.Identity;
                    document.ModifiedBy   = user.Name;
                    document.DateModified = DateTime.Today;
                    document.DocPath      = fileName;

                    db.Entry(document).State = EntityState.Modified;
                    await db.SaveChangesAsync();

                    return(RedirectToAction("Index"));
                }
                else
                {
                    ViewBag.Error        = "Can't add Document. Fill in the required Fields. ";
                    ViewBag.MatterNumber = new SelectList(db.Matters, "MatterNumber", "Subject", document.MatterNumber);
                    return(View(document));
                }
            }
            catch (Exception ex)
            {
                ViewBag.Error = "Can't add Document. Something went wrong " + ex.Message;
            }

            return(View(document));
        }
Ejemplo n.º 14
0
        public async Task <ActionResult> Edit([Bind(Include = "ClientId,FirstName,MiddleName,LastName,EmailAddress,PhoneNumber,Address,Town,PostalCode,Website,CreatedBy,CreatedOn,ModifiedBy,ModifiedOn,ClientNumber")] Client client)
        {
            if (ModelState.IsValid)
            {
                //int nextId = GetCurrentId() + 1;
                //string clienName = client.FirstName;
                //string firstLetter = clienName.Substring(0, 1);
                //string clientId = firstLetter + nextId.ToString() + "-" + DateTime.Today.ToShortDateString();

                var user = User.Identity;
                client.ModifiedBy = user.Name;
                client.ModifiedOn = DateTime.Today;
                //client.ClientNumber = clientId;

                db.Entry(client).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(client));
        }
        public async Task <ActionResult> Edit([Bind(Include = "Id,School,DateStart,EndDate,Major,DateAwarded,Graduated,Qualification,Description,Grade,StaffId,CreatedBy,CreatedOn,ModifiedBy,ModifiedOn")] Education education)
        {
            if (ModelState.IsValid)
            {
                var user = User.Identity.Name;
                education.ModifiedBy = user;
                education.ModifiedOn = DateTime.Today;
                education.StaffId    = LegalGuideUtility.StaffId;

                db.Entry(education).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Create", "Educations"));
            }
            //ViewBag.StaffId = new SelectList(db.Staffs, "StaffId", "FirstName", education.StaffId);
            ViewBag.Qualification = new List <SelectListItem>
            {
                new SelectListItem {
                    Text = "PhD", Value = "PhD"
                },
                new SelectListItem {
                    Text = "Msc", Value = "Msc"
                },
                new SelectListItem {
                    Text = "Bsc", Value = "Bsc"
                },
                new SelectListItem {
                    Text = "PGD", Value = "PGD"
                },
                new SelectListItem {
                    Text = "NCE", Value = "NCE"
                },
                new SelectListItem {
                    Text = "ND", Value = "ND"
                },
                new SelectListItem {
                    Text = "HND", Value = "HND"
                }
            };
            ViewBag.Grade = new List <SelectListItem>
            {
                new SelectListItem {
                    Text = "First Class", Value = "First Class"
                },
                new SelectListItem {
                    Text = "Second Class Upper", Value = "Second Class Upper"
                },
                new SelectListItem {
                    Text = "Second Class Lower", Value = "Second Class Lower"
                },
                new SelectListItem {
                    Text = "Third Class", Value = "Third Class"
                },
                new SelectListItem {
                    Text = "Pass", Value = "Pass"
                },
                new SelectListItem {
                    Text = "Not Available", Value = "Not Available"
                }
            };
            return(View(education));
        }
Ejemplo n.º 16
0
        public async Task <ActionResult> Edit([Bind(Include = "Id,FirstName,MiddleName,Gender,CreatedBy,CreatedOn,ModifiedBy,ModifiedOn,LastName,DOB,DOE,Status,Address,MaritalStatus,ImagePath,OfficeNo,MobileNo,EmailAddress,PersonalEmail,Relationship,KTelephone,NKEmail,NKAddress,Bank,AccountNumber,NKFullName,Password,StaffId,LineManagerId,Department,Designation,YearCallToBar,Location,AdvocateGroupId,NationalIdentityNumber,BloodGroup")] Staff staff, HttpPostedFileBase file)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    string fileName = string.Empty;
                    string filePath = string.Empty;

                    if (file.ContentLength > 0 && file != null)
                    {
                        filePath = file.FileName;
                        fileName = Path.GetFileName(file.FileName);
                    }
                    else
                    {
                        ViewBag.Error = " please select image to continue.";
                        return(View(staff));
                    }
                    var folderPath   = AppDomain.CurrentDomain.BaseDirectory + "/App_Data/StaffImages";
                    var fullFilePath = Path.Combine(folderPath, filePath);

                    var staffId = string.Empty;

                    var user = User.Identity.Name;
                    staff.ModifiedBy          = user;
                    staffId                   = staff.StaffId.ToUpper();
                    staff.ModifiedOn          = DateTime.Today;
                    LegalGuideUtility.StaffId = staffId; //ViewBag.StaffId=staff.StaffId;
                    staff.ImagePath           = fileName;
                    staff.Status              = true;


                    db.Entry(staff).State = EntityState.Modified;
                    await db.SaveChangesAsync();

                    return(RedirectToAction("Create", "Experiences"));
                }
                else
                {
                    ViewBag.Error  = "Can't Save Profile, Some fields are missing";
                    ViewBag.Gender = new List <SelectListItem> {
                        new SelectListItem {
                            Text = "Male", Value = "M"
                        },
                        new SelectListItem {
                            Text = "Female", Value = "F"
                        }
                    };
                    ViewBag.Marital = new List <SelectListItem> {
                        new SelectListItem {
                            Text = "Divorced", Value = "Divorced"
                        },
                        new SelectListItem {
                            Text = "Married", Value = "Married"
                        },
                        new SelectListItem {
                            Text = "Single", Value = "Single"
                        },
                        new SelectListItem {
                            Text = "Separated", Value = "Separated"
                        },
                        new SelectListItem {
                            Text = "Maried With Children", Value = "Maried With Children"
                        },
                        new SelectListItem {
                            Text = "Single With Children", Value = "Single With Children"
                        }
                    };
                    ViewBag.BloodGroup = new List <SelectListItem> {
                        new SelectListItem {
                            Text = "A", Value = "A"
                        },
                        new SelectListItem {
                            Text = "A-", Value = "A-"
                        },
                        new SelectListItem {
                            Text = "B", Value = "B"
                        },
                        new SelectListItem {
                            Text = "B-", Value = "B-"
                        },
                        new SelectListItem {
                            Text = "AB", Value = "AB"
                        },
                        new SelectListItem {
                            Text = "AB-", Value = "AB-"
                        },
                        new SelectListItem {
                            Text = "O", Value = "O"
                        },
                        new SelectListItem {
                            Text = "O-", Value = "O-"
                        },
                    };

                    return(View(staff));
                }
            }
            catch (Exception ex)
            {
                ViewBag.Error = "Can't Save Profile please check and try again." + ex.Message;
            }
            ViewBag.Gender = new List <SelectListItem> {
                new SelectListItem {
                    Text = "Male", Value = "M"
                },
                new SelectListItem {
                    Text = "Female", Value = "F"
                }
            };
            ViewBag.Marital = new List <SelectListItem> {
                new SelectListItem {
                    Text = "Divorced", Value = "Divorced"
                },
                new SelectListItem {
                    Text = "Married", Value = "Married"
                },
                new SelectListItem {
                    Text = "Single", Value = "Single"
                },
                new SelectListItem {
                    Text = "Separated", Value = "Separated"
                },
                new SelectListItem {
                    Text = "Maried With Children", Value = "Maried With Children"
                },
                new SelectListItem {
                    Text = "Single With Children", Value = "Single With Children"
                }
            };
            ViewBag.BloodGroup = new List <SelectListItem> {
                new SelectListItem {
                    Text = "A", Value = "A"
                },
                new SelectListItem {
                    Text = "A-", Value = "A-"
                },
                new SelectListItem {
                    Text = "B", Value = "B"
                },
                new SelectListItem {
                    Text = "B-", Value = "B-"
                },
                new SelectListItem {
                    Text = "AB", Value = "AB"
                },
                new SelectListItem {
                    Text = "AB-", Value = "AB-"
                },
                new SelectListItem {
                    Text = "O", Value = "O"
                },
                new SelectListItem {
                    Text = "O-", Value = "O-"
                },
            };
            return(View(staff));
        }
        public async Task <ActionResult> Edit([Bind(Include = "Subject,Description,AreaOfPractice,ClientId,LineManagerId,ArrivalDate,FiledOn,DueDate,MatterNumber,Priority,MatterStage,RequestedBy,MatterValue,EstimatedEffort,CreatedBy,CreatedOn,ModifiedBy,ModifiedOn,CaseNumber")] Matter matter)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    var user = User.Identity.Name;
                    matter.ModifiedBy = user;
                    matter.ModifiedOn = DateTime.Today;

                    db.Entry(matter).State = EntityState.Modified;
                    await db.SaveChangesAsync();

                    return(RedirectToAction("Index"));
                }
                catch (Exception)
                {
                    ViewBag.Error = "Can't Add Matter, Error Occured. Please Contact IT Department.";
                    //throw ex;
                }



                //db.Entry(matter).State = EntityState.Modified;
                //await db.SaveChangesAsync();
                //return RedirectToAction("Index");
            }
            else
            {
                ViewBag.Error    = "Fill in the required fields to continue";
                ViewBag.Priority = new List <SelectListItem> {
                    new SelectListItem {
                        Value = "Critical", Text = "Critical"
                    },
                    new SelectListItem {
                        Value = "High", Text = "High"
                    },
                    new SelectListItem {
                        Value = "Medium", Text = "Medium"
                    },
                    new SelectListItem {
                        Value = "Low", Text = "Low"
                    }
                };
                ViewBag.PracticeArea = new List <SelectListItem> {
                    new SelectListItem {
                        Value = "None", Text = "None"
                    },
                    new SelectListItem {
                        Value = "Acquisition", Text = "Acquisition"
                    },
                    new SelectListItem {
                        Value = "Administrative", Text = "Administrative"
                    },
                    new SelectListItem {
                        Value = "Audit", Text = "Audit"
                    },
                    new SelectListItem {
                        Value = "Civil", Text = "Civil"
                    },
                    new SelectListItem {
                        Value = "Commercial", Text = "Commercial"
                    },
                    new SelectListItem {
                        Value = "Consultation", Text = "Consultation"
                    },
                    new SelectListItem {
                        Value = "Corporate", Text = "Corporate"
                    },
                    new SelectListItem {
                        Value = "Criminal", Text = "Criminal"
                    },
                    new SelectListItem {
                        Value = "Dispute", Text = "Dispute"
                    },
                    new SelectListItem {
                        Value = "Due Deligence", Text = "Due Deligence"
                    },
                    new SelectListItem {
                        Value = "Labour", Text = "Labour"
                    },
                    new SelectListItem {
                        Value = "Real Estate", Text = "Real Estate"
                    },
                    new SelectListItem {
                        Value = "Sharia", Text = "Sharia"
                    },
                    new SelectListItem {
                        Value = "Agreement", Text = "Agreement"
                    }
                };
                ViewBag.Stage = new List <SelectListItem> {
                    new SelectListItem {
                        Value = "Discovery", Text = "Discovery"
                    },
                    new SelectListItem {
                        Value = "Trial", Text = "Trial"
                    },
                    new SelectListItem {
                        Value = "Apeal", Text = "Apeal"
                    },
                    new SelectListItem {
                        Value = "Motions", Text = "Motions"
                    },
                    new SelectListItem {
                        Value = "Closed", Text = "Closed"
                    },
                    new SelectListItem {
                        Value = "Pleading", Text = "Pleading"
                    }
                };
                ViewBag.ClientId = new SelectList(db.Clients, "ClientId", "FirstName", matter.ClientId);
                return(View(matter));
            }
            ViewBag.Priority = new List <SelectListItem> {
                new SelectListItem {
                    Value = "Critical", Text = "Critical"
                },
                new SelectListItem {
                    Value = "High", Text = "High"
                },
                new SelectListItem {
                    Value = "Medium", Text = "Medium"
                },
                new SelectListItem {
                    Value = "Low", Text = "Low"
                }
            };
            ViewBag.Stage = new List <SelectListItem> {
                new SelectListItem {
                    Value = "Discovery", Text = "Discovery"
                },
                new SelectListItem {
                    Value = "Trial", Text = "Trial"
                },
                new SelectListItem {
                    Value = "Apeal", Text = "Apeal"
                },
                new SelectListItem {
                    Value = "Motions", Text = "Motions"
                },
                new SelectListItem {
                    Value = "Closed", Text = "Closed"
                },
                new SelectListItem {
                    Value = "Pleading", Text = "Pleading"
                }
            };
            ViewBag.PracticeArea = new List <SelectListItem> {
                new SelectListItem {
                    Value = "None", Text = "None"
                },
                new SelectListItem {
                    Value = "Acquisition", Text = "Acquisition"
                },
                new SelectListItem {
                    Value = "Administrative", Text = "Administrative"
                },
                new SelectListItem {
                    Value = "Audit", Text = "Audit"
                },
                new SelectListItem {
                    Value = "Civil", Text = "Civil"
                },
                new SelectListItem {
                    Value = "Commercial", Text = "Commercial"
                },
                new SelectListItem {
                    Value = "Consultation", Text = "Consultation"
                },
                new SelectListItem {
                    Value = "Corporate", Text = "Corporate"
                },
                new SelectListItem {
                    Value = "Criminal", Text = "Criminal"
                },
                new SelectListItem {
                    Value = "Dispute", Text = "Dispute"
                },
                new SelectListItem {
                    Value = "Due Deligence", Text = "Due Deligence"
                },
                new SelectListItem {
                    Value = "Labour", Text = "Labour"
                },
                new SelectListItem {
                    Value = "Real Estate", Text = "Real Estate"
                },
                new SelectListItem {
                    Value = "Sharia", Text = "Sharia"
                },
                new SelectListItem {
                    Value = "Agreement", Text = "Agreement"
                }
            };
            ViewBag.ClientId = new SelectList(db.Clients, "ClientId", "FirstName", matter.ClientId);
            return(View(matter));
        }
Ejemplo n.º 18
0
        public async Task <ActionResult> Edit([Bind(Include = "Id,Name,ShortName,CompanyLegalType,CompanyGroup,Nationality,Address,City,State,Country,Website,PhoneNumber,MobileNumber,EmailAddress,CompanyLawyer,Capital,Currency,CreatedBy,CreatedOn,ModifiedBy,ModifiedOn")] Company company)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    var user = User.Identity.Name;
                    company.ModifiedBy = user;
                    company.ModifiedOn = DateTime.Today;

                    db.Entry(company).State = EntityState.Modified;
                    await db.SaveChangesAsync();

                    return(RedirectToAction("Index"));
                }
                catch (Exception)
                {
                    ViewBag.Error = "Can't Add Company, Error Occured. Please Contact IT Department.";
                }
            }
            else
            {
                ViewBag.Error     = "Fill in the required fields to continue";
                ViewBag.LegalType = new List <SelectListItem>
                {
                    new SelectListItem {
                        Value = "Criminal", Text = "Criminal"
                    },
                    new SelectListItem {
                        Value = "Civil", Text = "Civil"
                    }
                };
                ViewBag.Countries = new List <SelectListItem>
                {
                    new SelectListItem {
                        Value = "Algeria", Text = "Algeria"
                    },
                    new SelectListItem {
                        Value = "Benin", Text = "Benin"
                    },
                    new SelectListItem {
                        Value = "Cameroon", Text = "Cameroon"
                    },
                    new SelectListItem {
                        Value = "Djibouti", Text = "Djibouti"
                    },
                    new SelectListItem {
                        Value = "Egypt", Text = "Egypt"
                    },
                    new SelectListItem {
                        Value = "Ghana", Text = "Ghana"
                    },
                    new SelectListItem {
                        Value = "Kenya", Text = "Kenya"
                    },
                    new SelectListItem {
                        Value = "Liberia", Text = "Liberia"
                    },
                    new SelectListItem {
                        Value = "Mali", Text = "Mali"
                    },
                    new SelectListItem {
                        Value = "Nigeria", Text = "Nigeria"
                    },
                    new SelectListItem {
                        Value = "Rwanda", Text = "Rwanda"
                    },
                    new SelectListItem {
                        Value = "South Africa", Text = "South Africa"
                    },
                    new SelectListItem {
                        Value = "Tanzania", Text = "Tanzania"
                    },
                    new SelectListItem {
                        Value = "Uganda", Text = "Uganda"
                    },
                    new SelectListItem {
                        Value = "Zimbabwe", Text = "Zimbabwe"
                    },
                };
                return(View(company));
            }
            ViewBag.LegalType = new List <SelectListItem>
            {
                new SelectListItem {
                    Value = "Criminal", Text = "Criminal"
                },
                new SelectListItem {
                    Value = "Civil", Text = "Civil"
                }
            };
            ViewBag.Countries = new List <SelectListItem>
            {
                new SelectListItem {
                    Value = "Algeria", Text = "Algeria"
                },
                new SelectListItem {
                    Value = "Benin", Text = "Benin"
                },
                new SelectListItem {
                    Value = "Cameroon", Text = "Cameroon"
                },
                new SelectListItem {
                    Value = "Djibouti", Text = "Djibouti"
                },
                new SelectListItem {
                    Value = "Egypt", Text = "Egypt"
                },
                new SelectListItem {
                    Value = "Ghana", Text = "Ghana"
                },
                new SelectListItem {
                    Value = "Kenya", Text = "Kenya"
                },
                new SelectListItem {
                    Value = "Liberia", Text = "Liberia"
                },
                new SelectListItem {
                    Value = "Mali", Text = "Mali"
                },
                new SelectListItem {
                    Value = "Nigeria", Text = "Nigeria"
                },
                new SelectListItem {
                    Value = "Rwanda", Text = "Rwanda"
                },
                new SelectListItem {
                    Value = "South Africa", Text = "South Africa"
                },
                new SelectListItem {
                    Value = "Tanzania", Text = "Tanzania"
                },
                new SelectListItem {
                    Value = "Uganda", Text = "Uganda"
                },
                new SelectListItem {
                    Value = "Zimbabwe", Text = "Zimbabwe"
                },
            };
            return(View(company));
        }