public static void DDLState(Controller _controller, string key = "Title", string value = "Title", object selected = null, string countryName = null) { using (var objBLL = new MasterBLL()) { _controller.ViewBag.States = new SelectList(objBLL.GetStates(countryName), key, value, selected); } }
public static void DDLCountry(Controller _controller, string key = "Title", string value = "Title", object selected = null) { using (var objBLL = new MasterBLL()) { _controller.ViewBag.Countries = new SelectList(objBLL.GetCountries(), key, value, selected); } }
public static void DDLDepartment(Controller _controller, string key = "ID", string value = "Title", object selected = null) { using (var objBLL = new MasterBLL()) { _controller.ViewBag.Departments = new SelectList(objBLL.GetDepartments(), key, value, selected); } }
public proRent() { InitializeComponent(); Utility mUtility = new Utility(); MasterBLL mMasterBLL = new MasterBLL(); loadReference(); }
/// <summary> /// Bind Data to Drop Downs /// </summary> private void BindDropDownDistrict() { MasterBLL objMasterBLL = new MasterBLL(); ddlDistrict.DataTextField = "DistrictName"; ddlDistrict.DataValueField = "DistrictID"; ddlDistrict.DataSource = objMasterBLL.LoadDistrictData(); ddlDistrict.DataBind(); }
/// <summary> /// Bind Data to Drop Downs /// </summary> private void BindDropDownDistrict() { MasterBLL objMasterBLL = new MasterBLL(); ddlDistrict.DataTextField = "DistrictName"; ddlDistrict.DataValueField = "DistrictID"; ddlDistrict.DataSource = objMasterBLL.LoadDistrictData(); ddlDistrict.DataBind(); ddlDistrict.Items.Insert(0, (new ListItem("--Select--", "0"))); ddlDistrict.SelectedIndex = 0; }
/// <summary> /// To assign values to CurrencyTypeTotalEstBudget dropdownlist /// </summary> private void LoadCurrencyTotalEstimate() { MasterBLL objMasterBLL = new MasterBLL(); CurrencyList objCurrencyList = new CurrencyList(); objCurrencyList = objMasterBLL.LoadCurrency(); ddlCurrencyTypeTotalEstBudget.DataTextField = "CurrencyCode"; ddlCurrencyTypeTotalEstBudget.DataValueField = "CurrencyID"; ddlCurrencyTypeTotalEstBudget.DataSource = objCurrencyList; ddlCurrencyTypeTotalEstBudget.DataBind(); ddlCurrencyTypeTotalEstBudget.SelectedIndex = 0; }
/// <summary> /// To get the data from the database and bind it to the dropdown ddloptionGroup /// </summary> private void BindOptionGroups() { MasterBLL objMasterBLL = new MasterBLL(); ddloptionGroup.DataTextField = "OptionGroupName"; ddloptionGroup.DataValueField = "OptionGroupID"; ddloptionGroup.DataSource = objMasterBLL.LoadOptionGroupData(); ddloptionGroup.DataBind(); ListItem firstListItem = new ListItem("--Select--", "0"); ddloptionGroup.Items.Insert(0, firstListItem); }
/// <summary> /// SET DATA TO Dropdown ddlCurrentOperation /// </summary> private void BindProprietor() { objMasterBLL = new MasterBLL(); objProprietorList = objMasterBLL.LoadProprietorData(); if (objProprietorList.Count > 0) { ddlCurrentOperation.DataSource = objProprietorList; ddlCurrentOperation.DataTextField = "ProprietorName"; ddlCurrentOperation.DataValueField = "ProprietorID"; ddlCurrentOperation.DataBind(); } }
/// <summary> /// Bind data to ddlLandTenure drop down /// </summary> private void BindLandTenure() { objMasterBLL = new MasterBLL(); objTenureLandList = objMasterBLL.LoadTenureLand(); if (objTenureLandList.Count > 0) { ddlLandTenure.DataSource = objTenureLandList; ddlLandTenure.DataTextField = "Lnd_Tenure"; ddlLandTenure.DataValueField = "Lnd_TenureId"; ddlLandTenure.DataBind(); } ddlLandTenure.Items.Insert(0, "--Select--"); }
/// <summary> /// To assign values to CurrencyDropdownList /// </summary> private void LoadCurrencyEstimate() { MasterBLL objMasterBLL = new MasterBLL(); CurrencyList objCurrencyList = new CurrencyList(); objCurrencyList = objMasterBLL.LoadCurrency(); ddlCurrencyTypeEstBudget.Items.Clear(); ddlCurrencyTypeEstBudget.DataTextField = "CurrencyCode"; ddlCurrencyTypeEstBudget.DataValueField = "CurrencyID"; ddlCurrencyTypeEstBudget.DataSource = objCurrencyList; ddlCurrencyTypeEstBudget.DataBind(); //ddlCurrencyTypeEstBudget.Items.Insert(0, "--Select--"); ddlCurrencyTypeEstBudget.SelectedIndex = 0; }
private void LoadddlOptionGrp() { OptionGroupParametersBLL optGrpOBJ = new OptionGroupParametersBLL(); ListItem firstListItem = new ListItem(ddloptionGroup.Items[0].Text, ddloptionGroup.Items[0].Value); ddloptionGroup.Items.Clear(); MasterBLL objMasterBLL = new MasterBLL(); ddloptionGroup.DataTextField = "OptionGroupName"; ddloptionGroup.DataValueField = "OptionGroupID"; ddloptionGroup.DataSource = objMasterBLL.LoadOptionGroupData(); ddloptionGroup.DataBind(); ddloptionGroup.Items.Insert(0, firstListItem); }
/// <summary> /// Bind Data to Drop Downs /// </summary> private void BindSubCounties() { ListItem firstListItem = new ListItem(ddlSubCounty.Items[0].Text, ddlSubCounty.Items[0].Value); ddlSubCounty.Items.Clear(); if (ddlCounty.SelectedValue != "0") { MasterBLL objMasterBLL = new MasterBLL(); ddlSubCounty.DataTextField = "SubCountyName"; ddlSubCounty.DataValueField = "SubCountyID"; ddlSubCounty.DataSource = objMasterBLL.LoadSubCountyData(ddlCounty.SelectedValue); ddlSubCounty.DataBind(); } ddlSubCounty.Items.Insert(0, firstListItem); ddlSubCounty.SelectedIndex = 0; }
/// <summary> /// Bind Data to Drop Downs /// </summary> private void BindParish() { ListItem firstListItem = new ListItem(ddlParish.Items[0].Text, ddlParish.Items[0].Value); ddlParish.Items.Clear(); if (ddlSubCounty.SelectedValue != "0") { MasterBLL objMasterBLL = new MasterBLL(); ddlParish.DataTextField = "parishname"; ddlParish.DataValueField = "parishid"; ddlParish.DataSource = objMasterBLL.LoadParishData(ddlSubCounty.SelectedValue); ddlParish.DataBind(); } ddlParish.Items.Insert(0, firstListItem); ddlParish.SelectedIndex = 0; }
/// <summary> /// Bind Data to Drop Downs /// </summary> private void BindVillages() { //ListItem firstListItem = new ListItem(ddlVillage.Items[0].Text, ddlVillage.Items[0].Value); lstbVillages.Items.Clear(); if (ddlSubCounty.SelectedValue != "0") { MasterBLL objMasterBLL = new MasterBLL(); List <VillageBO> lstVillages = new List <VillageBO>(); lstVillages = objMasterBLL.LoadVillageData(ddlSubCounty.SelectedValue); lstbVillages.DataSource = lstVillages; lstbVillages.DataTextField = "VillageName"; lstbVillages.DataValueField = "VillageID"; lstbVillages.DataBind(); } }
public JsonResult GetAvailableAction() { IEnumerable <MasterModel> ls = new List <MasterModel>(); List <Select2DropDownModel> empddl = new List <Select2DropDownModel>(); ls = new MasterBLL().List("WFAction"); foreach (var item in ls) { empddl.Add(new Select2DropDownModel { id = item.Id.ToString(), text = item.Value }); } var JSONResult = Json(new { Data = empddl }, JsonRequestBehavior.AllowGet); JSONResult.MaxJsonLength = Int32.MaxValue; return(JSONResult); }
public JsonResult GetState(string countryname) { ResultVM result = new ResultVM(); try { using (MasterBLL oMasterBLL = new MasterBLL()) { result.Data = oMasterBLL.GetStates(countryname); result.IsSuccess = true; } } catch (Exception ex) { result.Errors = ex; result.Message = ex.Message; result.IsSuccess = false; Helper.LogException(ex, "MasterController_GetState"); } return(Json(result, JsonRequestBehavior.AllowGet)); }
/// <summary> /// get Data and set data to Labels /// </summary> private void BindLandType() { LandInfoBLL objLandInfoBLL = new LandInfoBLL(); PublicLandInfoBO objLandInfo = objLandInfoBLL.GetLandInfo(Convert.ToInt32(Session["HH_ID"])); if (objLandInfo != null) { objMasterBLL = new MasterBLL(); TenureLandList TenureLands = objMasterBLL.LoadTenureLand(); foreach (TenureLandBO objTenureLand in TenureLands) { if (objTenureLand.Lnd_TenureId == objLandInfo.LND_TENUREID) { lblLandType.Text = objTenureLand.Lnd_Tenure; break; } } } else { LandInfoPrivateBLL objLFPrivateBLL = new LandInfoPrivateBLL(); PrivateLandInfoBO objLandInfoPriv = objLFPrivateBLL.GetLandInfoPriv(Convert.ToInt32(Session["HH_ID"])); if (objLandInfoPriv != null) { objMasterBLL = new MasterBLL(); TenureLandList TenureLands = objMasterBLL.LoadTenureLand(); foreach (TenureLandBO objTenureLand in TenureLands) { if (objTenureLand.Lnd_TenureId == objLandInfoPriv.Lnd_TENUREIDPriv) { lblLandType.Text = objTenureLand.Lnd_Tenure; break; } } } } }
public MyIdentity() { bll = null; }
public MyIdentity(string mastername) { bll = new MasterBLL(mastername); }
public setRent() { InitializeComponent(); Utility mUtility = new Utility(); MasterBLL mMasterBLL = new MasterBLL(); }
public JsonResult UpdateSPK() { string _status = MyEnums.enumStatus.SUCCESS.ToString(); string _retId = "0"; string _errMsg = string.Empty; List <SPKAttachmentModel> _lsAttachment = new List <SPKAttachmentModel>(); List <SPKAdditionalModel> _lsAdditional = new List <SPKAdditionalModel>(); SPKHeaderModel _spk = new SPKHeaderModel(); SPKEquipmentModel _misc = new SPKEquipmentModel(); if (Session["UserLogon"] != null) { _spk.Id = Int32.Parse(Request.Form["SPKID"].ToString()); _spk.SPKDate = DateTime.Parse(Request.Form["TglSPK"].ToString()); _spk.JanjiPenyerahan = DateTime.Parse(Request.Form["JanjiSerah"].ToString()); _spk.Branch = Request.Form["Branch"].ToString(); _spk.LOTNo = Request.Form["Lot"].ToString(); _spk.Buyer = Request.Form["BuyerName"].ToString(); _spk.BuyerAddress = Request.Form["BuyerAddress"].ToString(); _spk.KTP = Request.Form["KTP"].ToString(); _spk.Phone = Request.Form["Phone"].ToString(); _spk.STNKName = Request.Form["STNKName"].ToString(); _spk.STNKAddress = Request.Form["AlamatSTNK"].ToString(); _spk.Email = Request.Form["Email"].ToString(); _spk.Merk = Request.Form["Merk"].ToString(); _spk.Warna = Request.Form["Warna"].ToString(); _spk.Year = Request.Form["Tahun"] == "" ? DateTime.Now.Year : int.Parse(Request.Form["Tahun"].ToString()); _spk.Karoseri = Request.Form["Karoseri"].ToString(); _spk.MachineNo = Request.Form["MachineNo"].ToString(); _spk.RangkaNo = Request.Form["RangkaNo"].ToString(); _spk.Pembiayaan = Request.Form["Pembiayaan"].ToString(); _spk.Via = Request.Form["Via"].ToString(); _spk.PercentageBunga = float.Parse(Request.Form["Bunga"].ToString()); _spk.OTRPrice = float.Parse(Request.Form["HargaOnTheRoad"].ToString()); _spk.KaroseriPrice = float.Parse(Request.Form["HargaKaroseri"].ToString()); _spk.TotalPrice = float.Parse(Request.Form["Total"].ToString()); _spk.DP = float.Parse(Request.Form["DP"].ToString()); _spk.TandaJadi = Request.Form["TandaJadi"].ToString(); _spk.Pembayaran = Request.Form["Pembayaran"].ToString(); _spk.TransferVia = Request.Form["TransferVia"].ToString(); _spk.AlamatKirim = Request.Form["AlamatKirim"].ToString(); _spk.City = int.Parse(Request.Form["City"].ToString()); _spk.CreatedDate = DateTime.Now; _spk.CreatedBy = Utilities.GetUserNameLogon((UserAppsModel)Session["UserLogon"]); if (Request.Form["IsKaroseri"].ToString() == "true") { _spk.IsKaroseri = true; } else { _spk.IsKaroseri = false; } if (Request.Form["IsOntheRoad"].ToString() == "true") { _spk.IsOnTR = true; } else { _spk.IsOnTR = false; } if (Request.Form["IsOffTheRoad"].ToString() == "true") { _spk.IsOffTR = true; } else { _spk.IsOffTR = false; } if (Request.Form["IsNoPilihan"].ToString() == "true") { _spk.IsChooseNo = true; } else { _spk.IsChooseNo = false; } _spk.KaroseriDesc = Request.Form["KaroseriDesc"].ToString(); _spk.ChooseNo = Request.Form["NoPilihan"].ToString(); _lsAdditional = JsonConvert.DeserializeObject <List <SPKAdditionalModel> >(Request.Form["Additional"]); foreach (string file in Request.Files) { var fileContent = Request.Files[file]; if (fileContent != null && fileContent.ContentLength > 0) { // get a stream var stream = fileContent.InputStream; var fileName = Path.GetFileName(fileContent.FileName); var reader = new System.IO.BinaryReader(stream); var Content = reader.ReadBytes(fileContent.ContentLength); _lsAttachment.Add(new SPKAttachmentModel { DocType = new MasterBLL().FindByValue("SPK", MyEnums.enumMaster.DocumentType.ToString()), AttachmentName = fileName, Attachment = Content, }); } } int _idocType = new MasterBLL().FindByValue("SPK", MyEnums.enumMaster.DocumentType.ToString()); WorklistModel wrkls = new WorklistModel(); wrkls.Actioner = Request.Form["Action"].ToString(); wrkls.Actor = Utilities.GetEmployeeID((UserAppsModel)Session["UserLogon"]); int result = new SPKBll().Update(_spk, _lsAdditional, _misc, _lsAttachment, _idocType, wrkls, out _errMsg); if (_errMsg != string.Empty) { _status = MyEnums.enumStatus.ERROR.ToString(); } } else { _status = MyEnums.enumStatus.ERROR.ToString(); _errMsg = "Your session Expired"; } return(Json(new { Status = _status, RetId = _retId, ErrMsg = _errMsg }, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 构造函数,分别通过用户ID或登录名来创建用户对象 /// </summary> /// <param name="masterid"></param> public void MyIdentityByMasterid(string masterid) { bll = new MasterBLL(); bll.LoadFromID(masterid); }