public DataTable GetChallanBasicData(string strPartyName, string strChallanNo, string strLCNo)
        {
            tblChallanOutTableAdapter adp = new tblChallanOutTableAdapter();

            if (strChallanNo == "")
            {
                strChallanNo = strChallanNo + "2";
            }
            DataTable dt = adp.GetChallanBasicData(strPartyName, Convert.ToInt32(strChallanNo), strLCNo);

            return(dt);
        }
        public string PutData(List <ChallanOut> records, int intChallanNo, string strPartyName, string strAddress, DateTime dteDate, string strLCNo, DateTime dteLCDate)
        {
            try
            {
                tblChallanOutTableAdapter          adp  = new tblChallanOutTableAdapter();
                sprInsertStockRegisterTableAdapter adp2 = new sprInsertStockRegisterTableAdapter();

                foreach (var x in records)
                {
                    adp.PutData(intChallanNo, strPartyName, strAddress, dteDate, x.strDetails, x.intQuantity, x.strRemarks, x.strPurchNo, x.dtePurchDate, strLCNo, dteLCDate);
                    adp2.PutBalanceData(2, intChallanNo, strPartyName, dteDate, x.strDetails, x.intQuantity, x.strRemarks);
                }

                return("Challan is created Successfully.");
            }
            catch (Exception e)
            {
                return("error");
            }
        }