public static string[] GetCompletionList(string prefixText, int count, string contextKey) { DMReceiptMaster Obj_Con = new DMReceiptMaster(); String[] SearchList = Obj_Con.GetSuggestRecord(prefixText); return(SearchList); }
protected void BtnSave_Click(object sender, EventArgs e) { DateTime dt1; String dtpFromDate = string.Empty; String Str1 = txtMonthDate.Text.Split('-')[0]; String Str2 = txtMonthDate.Text.Split('-')[1]; //string str = Convert.ToString(ddlPROPERTYTo.SelectedItem); //string[] s = str.Split('-'); int monthIndex; string desiredMonth = txtMonthDate.Text.Split('-')[0]; string[] MonthNames = CultureInfo.CurrentCulture.DateTimeFormat.MonthNames; monthIndex = Array.IndexOf(MonthNames, desiredMonth) + 1; // dtpFromDate = Convert.ToDateTime(txtMonthDate.Text).ToString("01-MMM-yyyy"); dtpFromDate = Convert.ToDateTime(txtMonthDate.Text).ToString("01-MM-yyyy"); int InsertRow = 0, InsertRowDtls = 0, UpdateProRent = 0, UpdateProMonth = 0, UpdateRemAmt = 0; Entity_Receipt.ReceiptNo = txtVoucherNo.Text.ToUpper(); Entity_Receipt.ReceiptDate = (!string.IsNullOrEmpty(txtDate.Text)) ? Convert.ToDateTime(txtDate.Text.Trim()) : Convert.ToDateTime("01-Jan-1753"); Entity_Receipt.PartyId = Convert.ToInt32(ddlReceivedFrom.SelectedValue); Entity_Receipt.PropertyId = Convert.ToInt32(ddlPROPERTYTo.SelectedValue); string str = Convert.ToString(ddlPROPERTYTo.SelectedItem); string[] s = str.Split('-'); Entity_Receipt.VoucherAmt = Convert.ToDecimal(txtAmount.Text); Entity_Receipt.PaidAmount = Convert.ToDecimal(txtPaidAmount.Text); Entity_Receipt.RemainingAmt = Convert.ToDecimal(txtRemAmt.Text); // Entity_Receipt.ForTheMonth = (!string.IsNullOrEmpty(txtMonthDate.Text)) ? Convert.ToDateTime(txtMonthDate.Text.Trim()) : Convert.ToDateTime("01-Jan-1753"); Entity_Receipt.ForTheMonth = Convert.ToDateTime(dtpFromDate); Entity_Receipt.UnitNo = s[1]; Entity_Receipt.Narration = txtNarration.Text.ToUpper(); Entity_Receipt.UserId = Convert.ToInt32(Session["UserID"]); Entity_Receipt.LoginDate = DateTime.Now; Entity_Receipt.FortheMonthYear = txtMonthDate.Text.ToString(); InsertRow = Obj_Receipt.InsertReceiptNew(ref Entity_Receipt, out StrError); if (InsertRow > 0) { if (Convert.ToDecimal(txtRemAmt.Text) == 0) { Entity_Receipt.ReceiptVoucherId = InsertRow; UpdateProRent = Obj_Receipt.UpdatePropertRentDtls(ref Entity_Receipt, out StrError); UpdateProMonth = Obj_Receipt.UpdatePropertMonthmapping(ref Entity_Receipt, out StrError); } else { UpdateRemAmt = Obj_Receipt.UpdateAmtPropertMonthmapping(ref Entity_Receipt, out StrError); } } if (InsertRow > 0) { Obj_Comm.ShowPopUpMsg("Record Saved Successfully", this.Page); MakeEmptyForm(); Entity_Receipt = null; Obj_Receipt = null; } }