public static string[] GetCompletionList(string prefixText, int count, string contextKey) { DMRecipeTemplate Obj_Recipe = new DMRecipeTemplate(); String[] SearchList = Obj_Recipe.GetSuggestedRecord(prefixText); return(SearchList); }
protected void BtnUpdate_Click(object sender, EventArgs e) { int UpdateRow = 0, UpdateRowDtls = 0; try { if (ViewState["EditID"] != null) { Entity_Recipe.RecipeId = Convert.ToInt32(ViewState["EditID"]); } Entity_Recipe.MenuItem = txtMenuName.Text.Trim(); Entity_Recipe.AmtPerPlate = Convert.ToDecimal(txtAmtPerPlate.Text.Trim()); Entity_Recipe.UserId = Convert.ToInt32(Session["UserId"]); Entity_Recipe.LoginDate = DateTime.Now; UpdateRow = Obj_Recipe.UpdateRecord(ref Entity_Recipe, out StrError); if (UpdateRow > 0) { if (ViewState["CurrentTable"] != null) { DataTable dtInsert = new DataTable(); dtInsert = (DataTable)ViewState["CurrentTable"]; for (int i = 0; i < dtInsert.Rows.Count; i++) { Entity_Recipe.ItemId = Convert.ToInt32(dtInsert.Rows[i]["ItemId"].ToString()); //---Split Quantity for qty and UnitId--- string str = dtInsert.Rows[i]["Quantity"].ToString(); String[] qtyUnit = str.Split('-'); Entity_Recipe.Qty = Convert.ToDecimal(qtyUnit[0]); Entity_Recipe.SubUnitId = Convert.ToInt32(dtInsert.Rows[i]["SubUnitId"].ToString()); Entity_Recipe.IngredAmt = Convert.ToDecimal(dtInsert.Rows[i]["IngredAmt"].ToString()); Entity_Recipe.ActualRate = Convert.ToDecimal(dtInsert.Rows[i]["ActualRate"].ToString()); Entity_Recipe.QtyPerUnit = Convert.ToDecimal(dtInsert.Rows[i]["QtyPerUnit"].ToString()); UpdateRowDtls = Obj_Recipe.InsertDetailsRecord(ref Entity_Recipe, out StrError); } } if (UpdateRow > 0) { obj_Comm.ShowPopUpMsg("Record Updated Successfully", this.Page); MakeControlEmpty(); MakeEmptyForm(); Entity_Recipe = null; Obj_Recipe = null; } } else { obj_Comm.ShowPopUpMsg("Please Enter Details ..!", this.Page); } } catch (Exception ex) { throw new Exception(ex.Message); } }