Esempio n. 1
0
        public ActionResult Create(user_rightViewModel user_right)
        {
            if (ModelState.IsValid)
            {
                foreach (var mn in user_right.ms_menus)
                {
                    ms_user_rights rights = new ms_user_rights()
                    {
                        user_rights_id = user_right.user_type.user_type_id,
                        job_level_id   = user_right.job_level.job_level_id,
                        menu_id        = mn.menu_id,
                        fl_active      = true,
                        created_date   = DateTime.Now,
                        created_by     = 0,
                        updated_date   = DateTime.Now,
                        updated_by     = 1,
                        deleted_date   = null,
                        deleted_by     = null,
                        org_id         = 0
                    };

                    db.ms_user_rights.Add(rights);
                    db.SaveChanges();
                }
            }

            //ViewBag.job_level_id = new SelectList(db.ms_job_level, "job_level_id", "job_level_code", user_right.job_level.job_level_id);
            //ViewBag.user_type_id = new SelectList(db.ms_user_type, "user_type_id", "user_type_code", user_right.user_type.user_type_id);

            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
        public ActionResult Create([Bind(Include = "job_level_id,job_level_code,job_level_name,fl_active,created_date,created_by,updated_date,updated_by,deleted_date,deleted_by,org_id")] ms_job_level ms_job_level)
        {
            if (ModelState.IsValid)
            {
                db.ms_job_level.Add(ms_job_level);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(ms_job_level));
        }
Esempio n. 3
0
        public ActionResult Create([Bind(Include = "location_id,location_code,location_name,fl_active,created_date,created_by,updated_date,updated_by,deleted_date,deleted_by,org_id")] ms_asset_location ms_asset_location)
        {
            if (ModelState.IsValid)
            {
                db.ms_asset_location.Add(ms_asset_location);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(ms_asset_location));
        }
        public ActionResult Create([Bind(Include = "approval_id,request_id,approval_date,approval_location_id,approval_dept_id,approval_employee_id,approval_level_id,approval_status_id,approval_noted,approval_suggestion_id,fl_active,created_date,created_by,updated_date,updated_by,deleted_date,deteled_by,org_id")] tr_disposal_approval tr_disposal_approval)
        {
            if (ModelState.IsValid)
            {
                db.tr_disposal_approval.Add(tr_disposal_approval);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tr_disposal_approval));
        }
        public ActionResult Create([Bind(Include = "approval_status_id,approval_status_code,approval_status_name")] ms_approval_status ms_approval_status)
        {
            if (ModelState.IsValid)
            {
                db.ms_approval_status.Add(ms_approval_status);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(ms_approval_status));
        }
Esempio n. 6
0
        public ActionResult Create([Bind(Include = "depreciation_id,asset_id,depreciation_type_id,asset_original_value,asset_original_currency_id,Currency_kurs,asset_book_value,fis_asset_residu_value,fis_asset_usefull_life,fis_ddb_precentage,mkt_asset_residu_value,mkt_asset_usefull_life,mkt_ddb_percentage,fl_active,created_date,created_by,updated_date,updated_by,deleted_date,deleted_by,org_id")] tr_depreciation tr_depreciation)
        {
            if (ModelState.IsValid)
            {
                db.tr_depreciation.Add(tr_depreciation);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tr_depreciation));
        }
Esempio n. 7
0
        public ActionResult Create([Bind(Include = "employee_id,employee_nik,employee_name,employee_email,fl_active,created_date,created_by,updated_date,updated_by,deleted_date,deleted_by,org_id,ip_address")] ms_employee ms_employee)
        {
            if (ModelState.IsValid)
            {
                db.ms_employee.Add(ms_employee);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(ms_employee));
        }
Esempio n. 8
0
        public ActionResult Create([Bind(Include = "depreciation_detail_id,depreciation_id,depreciation_type_id,period,period_year,period_month,fl_active,created_date,created_by,updated_date,updated_by,deleted_date,deleted_by,org_id")] tr_depreciation_detail tr_depreciation_detail)
        {
            if (ModelState.IsValid)
            {
                db.tr_depreciation_detail.Add(tr_depreciation_detail);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tr_depreciation_detail));
        }
        public ActionResult Create([Bind(Include = "request_id,asset_id,request_date,request_emp_id,request_dept_id,request_location_id,request_level_id,transfer_to_location_id,transfer_to_dept_id,transfer_to_emp_id,fl_approval,approval_date,request_status,fl_active,created_date,created_by,updated_date,updated_by,deleted_date,deleted_by,org_id")] tr_mutation_request tr_mutation_request)
        {
            if (ModelState.IsValid)
            {
                db.tr_mutation_request.Add(tr_mutation_request);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tr_mutation_request));
        }
Esempio n. 10
0
        public ActionResult Create([Bind(Include = "disposal_bap_id,disposal_id,disposal_dept_id,fl_disposal_process,disposal_bap_date,disposal_bap_description,disposal_upload_address,disposal_change_dept_id,fl_active,created_date,created_by,updated_date,updated_by,deleted_date,deleted_by,org_id")] tr_disposal_bap tr_disposal_bap)
        {
            if (ModelState.IsValid)
            {
                db.tr_disposal_bap.Add(tr_disposal_bap);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tr_disposal_bap));
        }
Esempio n. 11
0
        public ActionResult Create([Bind(Include = "insurance_activa_id,asset_id,insurance_activa_number,insurance_activa_name,insurance_activa_date,insurance_activa_exp_date,insurance_id,insurance_activa_description,fl_active,created_date,created_by,updated_date,updated_by,deleted_date,deleted_int,org_id")] tr_asset_insurance tr_asset_insurance)
        {
            if (ModelState.IsValid)
            {
                db.tr_asset_insurance.Add(tr_asset_insurance);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tr_asset_insurance));
        }
Esempio n. 12
0
        public ActionResult Create([Bind(Include = "disposal_type_id,disposal_type_code,disposal_type_name,disposal_by_dept_id")] ms_disposal_type ms_disposal_type)
        {
            if (ModelState.IsValid)
            {
                db.ms_disposal_type.Add(ms_disposal_type);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(ms_disposal_type));
        }
Esempio n. 13
0
        public ActionResult Create([Bind(Include = "asset_id,asset_type_id,asset_number,company_id,asset_reg_location_id,asset_reg_pic_id,category_id,asset_po_number,asset_do_number,asset_name,asset_merk,asset_serial_number,vendor_id,asset_receipt_date,location_id,department_id,asset_description,fl_active,created_date,created_by,updated_date,updated_by,deleted_date,deleted_by,org_id")] tr_asset_registration tr_asset_registration)
        {
            if (ModelState.IsValid)
            {
                db.tr_asset_registration.Add(tr_asset_registration);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tr_asset_registration));
        }
Esempio n. 14
0
        public ActionResult Create([Bind(Include = "asset_id,asset_img_address")] tr_asset_image tr_asset_image)
        {
            if (ModelState.IsValid)
            {
                db.tr_asset_image.Add(tr_asset_image);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tr_asset_image));
        }
        public ActionResult Create([Bind(Include = "depreciation_type_id,depreciation_type_code,depreciation_type_name,fl_active,created_date,created_by,update_date,update_by,deleted_date,deleted_by,org_id")] ms_depreciation_type ms_depreciation_type)
        {
            if (ModelState.IsValid)
            {
                db.ms_depreciation_type.Add(ms_depreciation_type);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(ms_depreciation_type));
        }
Esempio n. 16
0
        public ActionResult Create([Bind(Include = "range_id,range_type,range_code,range_min,range_max,fl_active,created_date,created_by,updated_date,updated_by,deleted_date,deleted_by,org_id")] ms_approval_range ms_approval_range)
        {
            if (ModelState.IsValid)
            {
                db.ms_approval_range.Add(ms_approval_range);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(ms_approval_range));
        }
Esempio n. 17
0
        public ActionResult Create([Bind(Include = "disposal_id,request_id,fl_pic_asset_comfirm,pic_asset_confirm_date,pic_asset_employee_id,pic_asset_level_id,pic_asset_received_date,pic_asset_received_employee_id,pic_asset_received_level_id,disposal_suggestion_id,disposal_sent_dept_id,disposal_sent_date,user_asset_received_employee_id,user_asset_received_level_id,user_asset_received_date,fl_active,created_date,created_by,updated_date,updated_by,deleted_date,deleted_by,org_id")] tr_disposal_process tr_disposal_process)
        {
            if (ModelState.IsValid)
            {
                db.tr_disposal_process.Add(tr_disposal_process);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tr_disposal_process));
        }
Esempio n. 18
0
        public ActionResult Create([Bind(Include = "module_id,module_code,module_name,fl_active,created_date,created_by,updated_date,updated_by,deleted_date,deleted_by,org_id,rec_order")] ms_module ms_module)
        {
            if (ModelState.IsValid)
            {
                db.ms_module.Add(ms_module);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(ms_module));
        }
Esempio n. 19
0
        public ActionResult Create([Bind(Include = "department_code,department_name,department_email")] ms_department ms_department)
        {
            if (ModelState.IsValid)
            {
                db.ms_department.Add(ms_department);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(ms_department));
        }
Esempio n. 20
0
        public ActionResult Create([Bind(Include = "asset_reg_pic_id,asset_reg_pic_code,asset_reg_pic_name,fl_active,created_date,created_by,updated_date,updated_by,deleted_date,deleted_by,org_id")] ms_asset_register_pic ms_asset_register_pic)
        {
            if (ModelState.IsValid)
            {
                db.ms_asset_register_pic.Add(ms_asset_register_pic);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(ms_asset_register_pic));
        }
Esempio n. 21
0
        public ActionResult Create([Bind(Include = "company_id,company_code,company_name,fl_active,created_date,created_by,updated_date,updated_by,deleted_date,deleted_by,org_id")] ms_asmin_company ms_asmin_company)
        {
            if (ModelState.IsValid)
            {
                db.ms_asmin_company.Add(ms_asmin_company);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(ms_asmin_company));
        }
Esempio n. 22
0
        public ActionResult Create([Bind(Include = "warranty_id,asset_id,warranty_number,warranty_item_name,warranty_date,warranty_exp_date,warranty_description,fl_active,created_date,created_by,updated_date,updated_by,deleted_date,deleted_by,org_id")] tr_asset_warranty tr_asset_warranty)
        {
            if (ModelState.IsValid)
            {
                db.tr_asset_warranty.Add(tr_asset_warranty);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tr_asset_warranty));
        }
Esempio n. 23
0
        public ActionResult Create([Bind(Include = "license_id,asset_id,license_number,license_name,license_issued_by,license_date,license_exp_date,license_description,fl_active,created_date,created_by,updated_date,updated_by,deleted_date,deleted_by,org_id")] tr_asset_license tr_asset_license)
        {
            if (ModelState.IsValid)
            {
                db.tr_asset_license.Add(tr_asset_license);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tr_asset_license));
        }
Esempio n. 24
0
        public ActionResult Create([Bind(Include = "user_id,user_name,user_password,employee_id,fl_active,created_date,created_by,updated_date,updated_by,deleted_date,deleted_by,org_id")] ms_user ms_user)
        {
            if (ModelState.IsValid)
            {
                db.ms_user.Add(ms_user);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.employee_id = new SelectList(db.ms_employee, "employee_id", "employee_nik", ms_user.employee_id);
            return(View(ms_user));
        }
Esempio n. 25
0
        public ActionResult Create([Bind(Include = "vendor_id,vendor_code,vendor_name,vendor_address,country_id,vendor_phone,vendor_mail,vendor_cp_name,vendor_cp_phone,vendor_cp_mail,vendor_description,fl_active,created_date,created_by,updated_date,updated_by,deleted_date,deleted_by,org_id")] ms_vendor ms_vendor)
        {
            if (ModelState.IsValid)
            {
                db.ms_vendor.Add(ms_vendor);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.country_id = new SelectList(db.ms_country, "country_id", "country_code", ms_vendor.country_id);
            return(View(ms_vendor));
        }
Esempio n. 26
0
        public ActionResult Create([Bind(Include = "app_id,app_key,app_value,app_desc")] sy_app_setting sy_app_setting)
        {
            if (ModelState.IsValid)
            {
                sy_app_setting.fl_active    = true;
                sy_app_setting.created_date = DateTime.Now;
                sy_app_setting.created_by   = UserProfile.UserId;

                db.sy_app_setting.Add(sy_app_setting);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(sy_app_setting));
        }
Esempio n. 27
0
        public ActionResult ChangePassword(AccountChangePasswordViewModel model)
        {
            ms_user _user = (from t in _db.ms_user
                             where t.user_name == model.UserName && t.user_id == model.user_id
                             select t).SingleOrDefault <ms_user>();

            if (_user != null)
            {
                if (model.NewPassword.ToLower().Equals(model.ConfirmPassword.ToLower()))
                {
                    _user.user_password    = App_Helpers.CryptorHelper.Encrypt(model.NewPassword, "MD5", true);
                    _user.fl_active        = true;
                    _user.updated_by       = UserProfile.UserId;
                    _user.updated_date     = DateTime.Now;
                    _user.deleted_by       = null;
                    _user.deleted_date     = null;
                    _db.Entry(_user).State = EntityState.Modified;
                    _db.SaveChanges();
                    ViewBag.ErrMessage = "Your password has been successfully changed.";
                    RedirectToAction("Index", "Account", null);
                    //RedirectToAction("Logout", "Account", null);
                }
                else
                {
                    //beda confirm
                    ViewBag.ErrMessage = "[New Password] not matched to [Confirm Password].";
                }
            }
            else
            {
                ViewBag.ErrMessage = "User " + _user.user_name + " not found...";
            }
            return(View(model));
        }
Esempio n. 28
0
        public ActionResult DeleteConfirmed(int id)
        {
            sy_email_log sy_email_log = db.sy_email_log.Find(id);

            db.sy_email_log.Remove(sy_email_log);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 29
0
        public ActionResult Create([Bind(Include = "emp_det_id,employee_id,company_id,department_id,job_level_id,user_type_id,fl_approver,range_id,fl_active,created_date,created_by,updated_date,updated_by,deleted_date,deleted_by,org_id")] ms_employee_detail ms_employee_detail)
        {
            if (ModelState.IsValid)
            {
                db.ms_employee_detail.Add(ms_employee_detail);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.range_id      = new SelectList(db.ms_approval_range, "range_id", "range_type", ms_employee_detail.range_id);
            ViewBag.company_id    = new SelectList(db.ms_asmin_company, "company_id", "company_code", ms_employee_detail.company_id);
            ViewBag.department_id = new SelectList(db.ms_department, "department_id", "department_code", ms_employee_detail.department_id);
            ViewBag.employee_id   = new SelectList(db.ms_employee, "employee_id", "employee_nik", ms_employee_detail.employee_id);
            ViewBag.job_level_id  = new SelectList(db.ms_job_level, "job_level_id", "job_level_code", ms_employee_detail.job_level_id);
            ViewBag.user_type_id  = new SelectList(db.ms_user_type, "user_type_id", "user_type_code", ms_employee_detail.user_type_id);
            return(View(ms_employee_detail));
        }
Esempio n. 30
0
 //[ValidateAntiForgeryToken]
 public JsonResult UpdateAssetStatus(string asset_number = "", int asset_status_id = 0)
 {
     try
     {
         (from atd in db.tr_asset_taking_detail where atd.asset_number == asset_number select atd).ToList()
         .ForEach(atd =>
         {
             atd.asset_status_id = asset_status_id;
             atd.updated_by      = UserProfile.UserId;
             atd.updated_date    = DateTime.Now;
         });
         db.SaveChanges();
         return(Json(1, JsonRequestBehavior.AllowGet));
     }
     catch
     {
         return(Json(0, JsonRequestBehavior.AllowGet));
     }
 }