public static string[] GetCompletionList(string prefixText, int count, string contextKey) { DMDailyRecipeTransaction Obj_Recipe = new DMDailyRecipeTransaction(); String[] SearchList = Obj_Recipe.GetSuggestedRecord(prefixText); return(SearchList); }
protected void BtnUpdate_Click(object sender, EventArgs e) { try { int UpdateRow = 0, UpdateRowDtls = 0; if (ViewState["EditID"] != null) { Entity_Recipe.OrderId = Convert.ToInt32(ViewState["EditID"]); } //Entity_Recipe.OrderDate = Convert.ToDateTime(txtDate.ToString()); Entity_Recipe.OrderDate = Convert.ToDateTime(System.DateTime.Now.ToString("dd/MMM/yyyy")); Entity_Recipe.TotalOrderCost = Convert.ToDecimal(txtTotalOrderCost.Text); 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.RecipeId = Convert.ToInt32(dtInsert.Rows[i]["RecipeId"].ToString()); Entity_Recipe.Qty = Convert.ToDecimal(dtInsert.Rows[i]["Quantity"].ToString()); Entity_Recipe.TotalAmt = Convert.ToDecimal(dtInsert.Rows[i]["TotalAmt"].ToString()); UpdateRowDtls = Obj_Recipe.InsertDetailsRecord(ref Entity_Recipe, out StrError); } } if (UpdateRow > 0 && UpdateRowDtls > 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); } }
protected void BtnSave_Click(object sender, EventArgs e) { try { int InsertRow = 0, InsertRowDtls = 0, InserStockDtls = 0; if (ChkDetails() == true) { //Entity_Recipe.OrderDate = Convert.ToDateTime(txtDate.ToString()); Entity_Recipe.OrderDate = Convert.ToDateTime(System.DateTime.Now.ToString("dd/MMM/yyyy")); Entity_Recipe.TotalOrderCost = Convert.ToDecimal(txtTotalOrderCost.Text); Entity_Recipe.UserId = Convert.ToInt32(Session["UserId"]); Entity_Recipe.LoginDate = DateTime.Now; InsertRow = Obj_Recipe.InsertRecord(ref Entity_Recipe, out StrError); if (InsertRow > 0) { if (ViewState["CurrentTable"] != null) { DataTable dtInsert = new DataTable(); DataTable dtInsertItem = new DataTable(); dtInsert = (DataTable)ViewState["CurrentTable"]; dtInsertItem = (DataTable)ViewState["ItemDetails"]; for (int i = 0; i < dtInsert.Rows.Count; i++) { Entity_Recipe.OrderId = InsertRow; Entity_Recipe.RecipeId = Convert.ToInt32(dtInsert.Rows[i]["RecipeId"].ToString()); Entity_Recipe.Qty = Convert.ToDecimal(dtInsert.Rows[i]["Quantity"].ToString()); Entity_Recipe.TotalAmt = Convert.ToDecimal(dtInsert.Rows[i]["TotalAmt"].ToString()); //---**StockDetails**--- InsertRowDtls = Obj_Recipe.InsertDetailsRecord(ref Entity_Recipe, out StrError); for (int j = 0; j < dtInsertItem.Rows.Count; j++) { if (Convert.ToInt32(dtInsert.Rows[i]["RecipeId"].ToString()) == Convert.ToInt32(dtInsertItem.Rows[j]["RecipeId"].ToString())) { Entity_Recipe.OrderId = InsertRow; Entity_Recipe.RecipeId = Convert.ToInt32(dtInsertItem.Rows[j]["RecipeId"].ToString()); Entity_Recipe.ItemId = Convert.ToInt32(GridItemDtls.Rows[j].Cells[1].Text); //Entity_Recipe.UnitId = DateTime.Now; Entity_Recipe.StockDate = DateTime.Now; Entity_Recipe.StockLocationID = Convert.ToInt32(Session["CafeteriaId"]); Entity_Recipe.QtyPerUnit = Convert.ToDecimal(GridItemDtls.Rows[j].Cells[8].Text); Entity_Recipe.ActualRate = Convert.ToDecimal(GridItemDtls.Rows[j].Cells[4].Text); InserStockDtls = Obj_Recipe.InsertStockDetails(ref Entity_Recipe, out StrError); } } } } if (InsertRow > 0 && InsertRowDtls > 0) { obj_Comm.ShowPopUpMsg("Record Saved 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); } }