public string SaveReceiptRange(string Code, string start, string end, string districtcode, string cashier, string total_amount) { string ret = ""; int recordId = int.Parse(Code); int startpoint = int.Parse(start); int endpoint = int.Parse(end); int cashier_Id = int.Parse(cashier); double amount = double.Parse(total_amount.Replace(",", "")); if (startpoint == endpoint) { ret = "Start Point cannot be equal to End point"; } else if (startpoint > endpoint) { ret = "Start Point cannot be less than End point"; } else if (amount.Equals(0)) { ret = "Total Amount cannot be Zero"; } else { string avail_status = bll.RangeIn(districtcode, cashier_Id, recordId); if (!avail_status.Equals("NO")) { ret = avail_status; } else { string status = bll.ReceiptRangeExists(recordId, startpoint, endpoint, districtcode); if (status.Equals("YES")) { string CreatedBy = HttpContext.Current.Session["Username"].ToString(); datafile.SaveReceiptRange(recordId, startpoint, endpoint, cashier, districtcode, amount, CreatedBy); if (recordId.Equals(0)) { ret = startpoint.ToString() + " - " + endpoint.ToString() + " Receipt Range has been Save Successfully"; } else { ret = startpoint.ToString() + " - " + endpoint.ToString() + " Receipt Range has been Update Successfully"; } } else { ret = status; } } } return(ret); }