protected void btnSave_Click(object sender, EventArgs e) { if (ValidateSlot()) { var lst = GetSlotCosts; //foreach (var t in lst) //{ //if(new OnHireBLL().ValidateSlotOnHire(t.ContainerNo, rdTransactionType.SelectedValue)){ // ScriptManager.RegisterStartupScript(this,this.GetType(),DateTime.Now.Ticks.ToString(),string.Format("alert('{0} already exist in Table');",t.ContainerNo),true); //return; //} //} //var feu = CountFEU(); ISlot slots = new SlotEntity { CreatedOn = DateTime.Now, CompanyID = 1,// user.CompanyId ModifiedOn = DateTime.Now, SlotOperatorID = ddlOperator.SelectedValue.ToInt(), LineID = ddlLineCode.SelectedValue.ToInt(), PODID = hdnPOD.Value.ToInt(), POLID = hdnPOL.Value.ToInt(), MovOrigin = ddlTerm1.SelectedValue.ToInt(), MovDestination = ddlTerm2.SelectedValue.ToInt(), EffectDt = txtEffectDate.Text.ToDateTime(), CreatedBy = user.Id, ModifiedBy = user.Id, }; var retrunVal = 0; if (ViewState["SlotId"] != null) { slots.SlotID = ViewState["SlotId"].ToInt(); retrunVal = new SlotBLL().SaveSlot(slots, 1); } else { retrunVal = new SlotBLL().SaveSlot(slots, 0); } if (retrunVal > 0) { Session.Remove("ISlotCost"); ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "alert('Saved successfully.');", true); Response.Redirect("ManageSlotCost.aspx"); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "alert('Error! Please try again.')", true); } } }
private void LoadSlot() { if (!ReferenceEquals(Session[Constants.SESSION_SEARCH_CRITERIA], null)) { SearchCriteria searchCriteria = (SearchCriteria)Session[Constants.SESSION_SEARCH_CRITERIA]; if (!ReferenceEquals(searchCriteria, null)) { BuildSearchCriteria(searchCriteria); CommonBLL commonBll = new CommonBLL(); gvwCharge.PageIndex = searchCriteria.PageIndex; if (searchCriteria.PageSize > 0) { gvwCharge.PageSize = searchCriteria.PageSize; } gvwCharge.DataSource = SlotBLL.GetAllSlots(searchCriteria, 1); gvwCharge.DataBind(); } } }
private void DeleteSlot(int SlotId) { SlotBLL.DeleteSlot(SlotId); LoadSlot(); ScriptManager.RegisterStartupScript(this, typeof(Page), "alert", "<script>javascript:void alert('" + ResourceManager.GetStringWithoutName("ERR00006") + "');</script>", false); }