예제 #1
0
 private List <BankUPI> ViewBankUpiDetails(long pRecordid, string con)
 {
     lstBankUpi = new List <BankUPI>();
     try
     {
         using (NpgsqlDataReader dr = NPGSqlHelper.ExecuteReader(con, CommandType.Text, "select recordid,bankid,upiid,upiname,statusname,'OLD' as typeofoperation from tblmstbankupidtls t join tblmststatus ts on t.statusid=ts.statusid and upper(statusname)=upper('active') where bankid=" + pRecordid + ""))
         {
             while (dr.Read())
             {
                 BankUPI obj = new BankUPI();
                 obj.pRecordid        = Convert.ToInt64(dr["recordid"]);
                 obj.pBankId          = Convert.ToInt64(dr["bankid"]);
                 obj.pUpiid           = Convert.ToString(dr["upiid"]);
                 obj.pUpiname         = Convert.ToString(dr["upiname"]);
                 obj.pStatusname      = Convert.ToString(dr["statusname"]);
                 obj.ptypeofoperation = Convert.ToString(dr["typeofoperation"]);
                 lstBankUpi.Add(obj);
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return(lstBankUpi);
 }
예제 #2
0
        public DataSet CategorywiseReport(DateTime fromdate, DateTime todate, string Category)
        {
            DataSet ds     = new System.Data.DataSet();
            string  strqry = string.Empty;

            try
            {
                if (Category == "0")
                {
                    strqry = "select billno, vchbillno, billdate, billtime, sessionid, tableid, vchkotid, itemid,itemname, amount,totalbillamount, totaldiscount,itemdicount, numservicetaxvale,numservicechargevale, vchdiscounttype, vchdiscount ,x.categoryid,y.itemcategoryname from (select billno, vw.vchbillno, billdate, vw.billtime, vw.sessionid,vw. tableid, vchkotid, vw.itemid,vw.itemname, amount,totalbillamount, totaldiscount,itemdicount, numservicetaxvale,numservicechargevale,vchdiscounttype, vchdiscount ,ti.categoryid from vwitemdiscountdetails vw  left join tabpositemmst ti on vw.itemid=ti.itemid )x left join tabpositemcategorymst y on x.categoryid=y.categoryid where billdate between '" + FormatDate(fromdate.ToString("dd/MM/yyyy")) + "' and '" + FormatDate(todate.ToString("dd/MM/yyyy")) + "'";
                }
                else
                {
                    strqry = "select billno, vchbillno, billdate, billtime, sessionid, tableid, vchkotid, itemid,itemname, amount,totalbillamount, totaldiscount,itemdicount, numservicetaxvale,numservicechargevale, vchdiscounttype, vchdiscount ,x.categoryid,y.itemcategoryname from (select billno, vw.vchbillno, billdate, vw.billtime, vw.sessionid,vw. tableid, vchkotid, vw.itemid,vw.itemname, amount,totalbillamount, totaldiscount,itemdicount, numservicetaxvale,numservicechargevale,vchdiscounttype, vchdiscount ,ti.categoryid from vwitemdiscountdetails vw  left join tabpositemmst ti on vw.itemid=ti.itemid )x left join tabpositemcategorymst y on x.categoryid=y.categoryid where billdate between '" + FormatDate(fromdate.ToString("dd/MM/yyyy")) + "' and '" + FormatDate(todate.ToString("dd/MM/yyyy")) + "' and y.categoryid=" + Category + ";";
                }
                ds = NPGSqlHelper.ExecuteDataset(NPGSqlHelper.SQLConnString, CommandType.Text, strqry);
            }
            catch (Exception ex)
            {
                EventLogger.WriteToErrorLog(ex, "Category Report");
                throw ex;
            }


            return(ds);
        }
        public InsurenceNameAndCodeDTO GetInsurenceNameAndCodeDetails(string InsurenceName, string InsurenceNameCode, string ConnectionString)
        {
            InsurenceNameAndCodeDTO objInsurenceNameAndCode = new InsurenceNameAndCodeDTO();

            try
            {
                using (NpgsqlDataReader dr = NPGSqlHelper.ExecuteReader(ConnectionString, CommandType.Text, "select insuranceschemeconfigid,insuranceschemename,insuranceschemecode,companycode,branchcode,series,serieslength,insuranceschemenamecode,statusid from tblmstinsuranceconfig where upper(insuranceschemename) = '" + ManageQuote(InsurenceName.ToUpper()) + "' and upper(insuranceschemenamecode) ='" + ManageQuote(InsurenceNameCode.ToUpper()) + "' and statusid = " + Convert.ToInt32(Status.Active) + ";"))
                {
                    while (dr.Read())
                    {
                        objInsurenceNameAndCode.pInsurenceconfigid = Convert.ToInt64(dr["insuranceschemeconfigid"]);
                        objInsurenceNameAndCode.pInsurencename     = dr["insuranceschemename"].ToString();
                        objInsurenceNameAndCode.pInsurencecode     = dr["insuranceschemecode"].ToString();
                        objInsurenceNameAndCode.pCompanycode       = dr["companycode"].ToString();
                        objInsurenceNameAndCode.pBranchcode        = dr["branchcode"].ToString();
                        objInsurenceNameAndCode.pSeries            = dr["series"].ToString();
                        objInsurenceNameAndCode.pSerieslength      = Convert.ToInt64(dr["serieslength"]);
                        objInsurenceNameAndCode.pInsurencenamecode = dr["insuranceschemenamecode"].ToString();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(objInsurenceNameAndCode);
        }
예제 #4
0
        public DataSet ShiftwiseItemSaleReport(DateTime fromdate, DateTime todate, string Shift)
        {
            DataSet ds     = new System.Data.DataSet();
            string  strqry = string.Empty;

            try
            {
                if (Shift == "0")
                {
                    strqry = " select itemid,itemname,sessionname,case when amount>0 then(amount+numservicetaxvale+numservicechargevale-itemdicount) else 0 end as itemqty,'Amount' as subname from vwitemdiscountdetails vw join tabpossessionmst s on s.sessionid=vw.sessionid where billdate between '" + FormatDate(fromdate.ToString("dd/MM/yyyy")) + "' and '" + FormatDate(todate.ToString("dd/MM/yyyy")) + "' union all select itemid,itemname,sessionname,itemqty,'Quantity' from vwitemdiscountdetails vw join tabpossessionmst s on s.sessionid=vw.sessionid where billdate between '" + FormatDate(fromdate.ToString("dd/MM/yyyy")) + "' and '" + FormatDate(todate.ToString("dd/MM/yyyy")) + "' order by itemname;";
                }
                else
                {
                    strqry = " select itemid,itemname,sessionname,case when amount>0 then(amount+numservicetaxvale+numservicechargevale-itemdicount) else 0 end as itemqty,'Amount' as subname from vwitemdiscountdetails vw join tabpossessionmst s on s.sessionid=vw.sessionid where  vw.sessionid='" + Shift + "' and billdate between '" + FormatDate(fromdate.ToString("dd/MM/yyyy")) + "' and '" + FormatDate(todate.ToString("dd/MM/yyyy")) + "' union all select itemid,itemname,sessionname,itemqty,'Quantity' from vwitemdiscountdetails vw join tabpossessionmst s on s.sessionid=vw.sessionid where  vw.sessionid='" + Shift + "' and billdate between '" + FormatDate(fromdate.ToString("dd/MM/yyyy")) + "' and '" + FormatDate(todate.ToString("dd/MM/yyyy")) + "' order by itemname;";
                }

                ds = NPGSqlHelper.ExecuteDataset(NPGSqlHelper.SQLConnString, CommandType.Text, strqry);
            }
            catch (Exception ex)
            {
                EventLogger.WriteToErrorLog(ex, "BillWise Report");
                throw ex;
            }
            return(ds);
        }
예제 #5
0
        public DataTable GetBillNumbers(string Billtype)
        {
            DataTable dt     = new DataTable();
            string    strdta = string.Empty;

            try
            {
                if (Billtype == "Dinning")
                {
                    strdta = "select vchbillno,recordid from tabposbillsettlement WHERE statusid=1 and vchbillno like 'B%' order by recordid;";
                }
                else if (Billtype == "TakeAway")
                {
                    strdta = "select vchbillno,recordid from tabposbillsettlement WHERE statusid=1 and vchbillno like 'TB%' order by recordid;";
                }
                else if (Billtype == "HomeDelivery")
                {
                    strdta = "select vchbillno,recordid from tabposbillsettlement WHERE statusid=1 and vchbillno like 'HB%' order by recordid;";
                }

                //strdta = "select vchbillno,recordid,regexp_replace(vchbillno, '[^0-9]+', '')::text as ordernumber from tabposbillsettlement WHERE statusid=1 order by ordernumber;";
                // strdta = "select vchbillno,recordid,replace(vchbillno,'B','')::int as ordernumber from tabposbillsettlement WHERE statusid=1 order by ordernumber;";
                dt = NPGSqlHelper.ExecuteDataset(NPGSqlHelper.SQLConnString, CommandType.Text, strdta).Tables[0];
            }
            catch (Exception ex)
            {
                throw;
            }
            return(dt);
        }
예제 #6
0
        public List <ContactMasterDTO> GetContactdetails(string ConnectionString)
        {
            List <ContactMasterDTO> lstcontactdetails = new List <ContactMasterDTO>();

            try
            {
                dr = NPGSqlHelper.ExecuteReader(ConnectionString, CommandType.Text, "select x.*,y.statusname from (select tc.contacttype,tc.name,tc.surname,tc.contactid,tc.contactreferenceid,tc.statusid,tca.contactname,tca.contactnumber,tca.emailid,tca.priority from tblmstcontact tc  join TBLMSTCONTACTPERSONDETAILS tca on tc.contactreferenceid=tca.contactreferenceid where upper(tca.priority)='PRIMARY') x left join tblmststatus y on x.statusid=y.statusid");
                while (dr.Read())
                {
                    ContactMasterDTO obj = new ContactMasterDTO();
                    obj.pContactId    = Convert.ToInt64(dr["contactid"]);
                    obj.pReferenceId  = dr["contactreferenceid"].ToString();
                    obj.pContactType  = dr["contacttype"].ToString();
                    obj.pStatusid     = dr["statusid"].ToString();
                    obj.pStatusname   = dr["statusname"].ToString();
                    obj.pName         = dr["name"].ToString();
                    obj.pSurName      = dr["surname"].ToString();
                    obj.pEmailidsList = new List <EmailidsDTO>();
                    obj.pEmailidsList.Add(new EmailidsDTO
                    {
                        pContactNumber = dr["contactnumber"].ToString()
                        ,
                        pEmailId = dr["emailid"].ToString()
                    });

                    lstcontactdetails.Add(obj);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(lstcontactdetails);
        }
예제 #7
0
        public DataSet SectionWiseSaleReport(DateTime fromdate, DateTime todate, string section)
        {
            DataSet ds     = new System.Data.DataSet();
            string  strqry = string.Empty;

            try
            {
                if (section == "0")
                {
                    //string strqry = "select vw.itemid,y.itemcategoryname,billno, vw.vchbillno,vw. tableid, vchkotid, vw.itemid,vw.itemname, amount,totalbillamount, totaldiscount,itemdicount, numservicetaxvale,numservicechargevale, vchdiscounttype, vchdiscount ,y.categoryid,s.sectionid,s.sectionname from vwitemdiscountdetails vw  left join (select itemid,z.itemcategoryname,z.categoryid from tabpositemmst x left join tabpositemcategorymst z on x.categoryid=z.categoryid and  x.categoryid=z.categoryid)y on y.itemid=vw.itemid left join tabpostablesandcoversmst s on s.tableid=vw.tableid;";
                    strqry = "select vw.itemid,y.itemcategoryname,billno, vw.vchbillno,vw. tableid, vchkotid, vw.itemid,vw.itemname, amount,totalbillamount, totaldiscount,itemdicount, numservicetaxvale,numservicechargevale, vchdiscounttype, vchdiscount ,y.categoryid,s.sectionid,s.sectionname from vwitemdiscountdetails vw  left join (select itemid,z.itemcategoryname,z.categoryid from tabpositemmst x left join tabpositemcategorymst z on x.categoryid=z.categoryid and  x.categoryid=z.categoryid)y on y.itemid=vw.itemid left join tabpostablesandcoversmst s on s.tablesname=vw.tableid where billdate between '" + FormatDate(fromdate.ToString("dd/MM/yyyy")) + "' and '" + FormatDate(todate.ToString("dd/MM/yyyy")) + "';";
                }
                else
                {
                    strqry = "select vw.itemid,y.itemcategoryname,billno, vw.vchbillno,vw. tableid, vchkotid, vw.itemid,vw.itemname, amount,totalbillamount, totaldiscount,itemdicount, numservicetaxvale,numservicechargevale, vchdiscounttype, vchdiscount ,y.categoryid,s.sectionid,s.sectionname from vwitemdiscountdetails vw  left join (select itemid,z.itemcategoryname,z.categoryid from tabpositemmst x left join tabpositemcategorymst z on x.categoryid=z.categoryid and  x.categoryid=z.categoryid)y on y.itemid=vw.itemid left join tabpostablesandcoversmst s on s.tablesname=vw.tableid where billdate between '" + FormatDate(fromdate.ToString("dd/MM/yyyy")) + "' and '" + FormatDate(todate.ToString("dd/MM/yyyy")) + "' and sectionid=" + section + ";";
                }
                ds = NPGSqlHelper.ExecuteDataset(NPGSqlHelper.SQLConnString, CommandType.Text, strqry);
            }
            catch (Exception ex)
            {
                EventLogger.WriteToErrorLog(ex, "SectionWiseSale Report");
                throw ex;
            }


            return(ds);
        }
        public async Task <List <SelfBankDetailsDTO> > GetBankDetails(int Contactid, string ConnectionString)
        {
            List <SelfBankDetailsDTO> lstBankdetails = new List <SelfBankDetailsDTO>();
            await Task.Run(() =>
            {
                try
                {
                    using (NpgsqlDataReader dr = NPGSqlHelper.ExecuteReader(ConnectionString, CommandType.Text, "select bankname,accountno,ifsccode,branch from tabapplicationpersonalbankdetails where contactid=" + Contactid + " and isprimarybank=true ;"))
                    {
                        while (dr.Read())
                        {
                            SelfBankDetailsDTO objBankdetails = new SelfBankDetailsDTO();
                            objBankdetails.pBankname          = dr["bankname"];
                            objBankdetails.pAccountno         = dr["accountno"];
                            objBankdetails.pIfsccode          = dr["ifsccode"];
                            objBankdetails.pBranhname         = dr["branch"];
                            lstBankdetails.Add(objBankdetails);
                        }
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            });

            return(lstBankdetails);
        }
        public async Task <List <BranchNamesDTO> > GetBranchName(string Companyname, string ConnectionString)
        {
            List <BranchNamesDTO> lstBranchname = new List <BranchNamesDTO>();
            await Task.Run(() =>
            {
                try
                {
                    using (NpgsqlDataReader dr = NPGSqlHelper.ExecuteReader(ConnectionString, CommandType.Text, "select  code,branchname from tabbranchcodes where companyname='" + Companyname + "' order by branchname;"))
                    {
                        while (dr.Read())
                        {
                            BranchNamesDTO objBranchname = new BranchNamesDTO();
                            objBranchname.pBranchid      = dr["code"];
                            objBranchname.pBranchname    = dr["branchname"];
                            lstBranchname.Add(objBranchname);
                        }
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            });

            return(lstBranchname);
        }
        public async Task <List <FdAccountDTO> > GetFdAcnumbers(string branchname, int memberid, Int64 fdconfigid, string ConnectionString)
        {
            List <FdAccountDTO> lstFDAccountno = new List <FdAccountDTO>();
            await Task.Run(() =>
            {
                try
                {
                    //select fdaccountid, fdaccountno, membername from vwfddata where chitbranchname = '" + branchname + "' and memberid = " + memberid + " and fdconfigid = "+fdconfigid+" and fdaccountid not in(select fd_account_id from self_or_adjustment)
                    using (NpgsqlDataReader dr = NPGSqlHelper.ExecuteReader(ConnectionString, CommandType.Text, "select fdaccountid,fdaccountno,membername from vwfdtransaction_details where chitbranchname='" + branchname + "' and memberid=" + memberid + " and fdconfigid=" + fdconfigid + " and balanceamount<=0 and interestpayout<>'On Maturity'  and fdaccountid not in(select trans_type_id from maturity_bonds) and fdaccountid not in(select fd_account_id from self_or_adjustment) ;"))
                    {
                        while (dr.Read())
                        {
                            FdAccountDTO objFDAccountno     = new FdAccountDTO();
                            objFDAccountno.pFdaccountid     = dr["fdaccountid"];
                            objFDAccountno.pFdaccountnumber = dr["fdaccountno"];
                            objFDAccountno.pMembername      = dr["membername"];
                            lstFDAccountno.Add(objFDAccountno);
                        }
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            });

            return(lstFDAccountno);
        }
        public async Task <List <CompanyNamesDTO> > GetCompanyname(string ConnectionString)
        {
            List <CompanyNamesDTO> lstCompanyname = new List <CompanyNamesDTO>();
            await Task.Run(() =>
            {
                try
                {
                    using (NpgsqlDataReader dr = NPGSqlHelper.ExecuteReader(ConnectionString, CommandType.Text, "select distinct companyname from tabbranchcodes;"))
                    {
                        while (dr.Read())
                        {
                            CompanyNamesDTO objCompanyname = new CompanyNamesDTO();
                            objCompanyname.pcompanyname    = dr["companyname"];
                            lstCompanyname.Add(objCompanyname);
                        }
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            });

            return(lstCompanyname);
        }
        public async Task <List <MembersDTO> > GetMembers(string branchname, Int64 fdconfigid, string ConnectionString)
        {
            List <MembersDTO> lstMembers = new List <MembersDTO>();
            await Task.Run(() =>
            {
                try
                {
                    //select distinct contactid,memberid,membercode,membername,mobileno from vwfddata where chitbranchname = '" + branchname + "' and fdconfigid = "+ fdconfigid + " order by membername
                    string query = "select distinct memberid,membercode,membername,mobileno,contactid from vwfdtransaction_details where chitbranchname='" + branchname + "' and fdconfigid=" + fdconfigid + " and balanceamount<=0 and interestpayout<>'On Maturity' and fdaccountid not in(select trans_type_id from maturity_bonds) and fdaccountid not in(select fd_account_id from self_or_adjustment) order by membername";
                    using (NpgsqlDataReader dr = NPGSqlHelper.ExecuteReader(ConnectionString, CommandType.Text, query))
                    {
                        while (dr.Read())
                        {
                            MembersDTO objMembers  = new MembersDTO();
                            objMembers.pMemberid   = dr["memberid"];
                            objMembers.pMembercode = dr["membercode"];
                            objMembers.pMembername = dr["membername"];
                            objMembers.pMobileno   = dr["mobileno"];
                            objMembers.pContactid  = dr["contactid"];
                            lstMembers.Add(objMembers);
                        }
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            });

            return(lstMembers);
        }
        public async Task <List <SchemeTypeDTO> > GetSchemeType(string BranchName, string ConnectionString)
        {
            List <SchemeTypeDTO> lstSchemetype = new List <SchemeTypeDTO>();
            string query = string.Empty;
            await Task.Run(() =>
            {
                try
                {
                    //query = "select distinct tc.fdname,tc.fdconfigid from tblmstfixeddepositConfig tc join tbltransfdcreation  tf on tc.fdconfigid=tf.fdconfigid and tf.statusid=" + Convert.ToInt32(Status.Active) + "  where chitbranchname='"+ BranchName + "' AND tc.statusid=" + Convert.ToInt32(Status.Active) + " order by fdname";
                    query = "select distinct fdconfigid,fdname from vwfdtransaction_details  where chitbranchname='" + BranchName + "' and balanceamount<=0 and interestpayout<>'On Maturity' and fdaccountid not in(select trans_type_id from maturity_bonds) and fdaccountid not in(select fd_account_id from self_or_adjustment) order by fdname";
                    using (NpgsqlDataReader dr = NPGSqlHelper.ExecuteReader(ConnectionString, CommandType.Text, query))
                    {
                        while (dr.Read())
                        {
                            SchemeTypeDTO objSchemetypes = new SchemeTypeDTO();
                            objSchemetypes.pSchemeid     = dr["fdconfigid"];
                            objSchemetypes.pSchemeName   = dr["fdname"];
                            lstSchemetype.Add(objSchemetypes);
                        }
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            });

            return(lstSchemetype);
        }
예제 #14
0
 public List <BankInformationAddressDTO> ViewBankAddressInformation(Int64 pRecordid, string con)
 {
     lstBankInformationAddress = new List <BankInformationAddressDTO>();
     try
     {
         using (NpgsqlDataReader dr = NPGSqlHelper.ExecuteReader(con, CommandType.Text, "select recordid,bankid,address1,address2,city,t.district,coalesce(t3.districtid,0) districtid,t.state,coalesce(t2.stateid,0) stateid,t.country,coalesce(t1.countryid,0) countryid,pincode,statusname,'OLD' as typeofoperation from tblmstbankaddressdtls t join tblmststatus ts on t.statusid=ts.statusid and upper(statusname)=upper('active') left join tblmstcountry t1 on t.country=t1.country left join tblmststate t2 on t.state=t2.state left join tblmstdistrict t3 on t.district=t3.district where bankid =" + pRecordid + ""))
         {
             while (dr.Read())
             {
                 BankInformationAddressDTO obj = new BankInformationAddressDTO();
                 obj.pRecordid        = Convert.ToInt64(dr["recordid"]);
                 obj.pBankId          = Convert.ToInt64(dr["bankid"]);
                 obj.pAddress1        = Convert.ToString(dr["address1"]);
                 obj.pAddress2        = Convert.ToString(dr["address2"]);
                 obj.pcity            = Convert.ToString(dr["city"]);
                 obj.pDistrict        = Convert.ToString(dr["district"]);
                 obj.pState           = Convert.ToString(dr["state"]);
                 obj.pCountry         = Convert.ToString(dr["country"]);
                 obj.pPincode         = Convert.ToString(dr["pincode"]);
                 obj.pStatusname      = Convert.ToString(dr["statusname"]);
                 obj.ptypeofoperation = Convert.ToString(dr["typeofoperation"]);
                 obj.pstateid         = Convert.ToInt64(dr["stateid"]);
                 obj.pcountryid       = Convert.ToInt64(dr["countryid"]);
                 obj.pdistrictid      = Convert.ToInt64(dr["districtid"]);
                 lstBankInformationAddress.Add(obj);
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return(lstBankInformationAddress);
 }
예제 #15
0
        public List <ShareAccNameDetails> GetShareAccountNameDetails(string ConnectionString)
        {
            List <ShareAccNameDetails> _ShareAccNameDetails = new List <ShareAccNameDetails>();

            try
            {
                using (NpgsqlDataReader dr = NPGSqlHelper.ExecuteReader(ConnectionString, CommandType.Text, "select shareconfigid, sharename, sharenamecode from tblmstshareconfig where shareconfigid in (select distinct share_config_id from Share_Account_creation where statusid = " + Convert.ToInt32(Status.Active) + ") order by sharename;"))
                {
                    while (dr.Read())
                    {
                        ShareAccNameDetails _objShareAccNameDetails = new ShareAccNameDetails();

                        _objShareAccNameDetails.pShareconfigid = Convert.ToInt64(dr["shareconfigid"]);
                        _objShareAccNameDetails.pSharename     = Convert.ToString(dr["sharename"]);
                        _objShareAccNameDetails.pShareNameCode = Convert.ToString(dr["sharenamecode"]);
                        _ShareAccNameDetails.Add(_objShareAccNameDetails);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(_ShareAccNameDetails);
        }
        public async Task <List <ChitBranchDetails> > GetFDBranchDetails(string Connectionstring)
        {
            List <ChitBranchDetails> _ChitBranchDetailsList = new List <ChitBranchDetails>();
            await Task.Run(() =>
            {
                try
                {
                    using (NpgsqlDataReader dr = NPGSqlHelper.ExecuteReader(Connectionstring, CommandType.Text, "select distinct chitbranchid,chitbranchname from vwfdtransaction_details where balanceamount<=0 and interestpayout<>'On Maturity' and fdaccountid not in(select trans_type_id from maturity_bonds) and fdaccountid not in(select fd_account_id from self_or_adjustment)  order by chitbranchname;"))
                    {
                        while (dr.Read())
                        {
                            var _ChitBranchDetails = new ChitBranchDetails
                            {
                                pBranchId   = Convert.ToInt64(dr["chitbranchid"]),
                                pBranchname = dr["chitbranchname"],
                            };
                            _ChitBranchDetailsList.Add(_ChitBranchDetails);
                        }
                    }
                }
                catch (Exception)
                {
                    throw;
                }
            });

            return(_ChitBranchDetailsList);
        }
예제 #17
0
        public List <ShareTransactionDTO> GetShareTransaction(Int64 ShareAccountId, string Connectionstring)
        {
            List <ShareTransactionDTO> lstShareTransaction = new List <ShareTransactionDTO>();

            try
            {
                using (NpgsqlDataReader dr = NPGSqlHelper.ExecuteReader(Connectionstring, CommandType.Text, "select trans_date, receipt_no, received_amount, mode_of_receipt from saving_account_receipt where saving_account_id = " + ShareAccountId + " and status = true;"))
                {
                    while (dr.Read())
                    {
                        ShareTransactionDTO objShareTransactionDTO = new ShareTransactionDTO();
                        objShareTransactionDTO.ptransdate      = dr["trans_date"] == DBNull.Value ? null : Convert.ToDateTime(dr["trans_date"]).ToString("dd/MM/yyyy");
                        objShareTransactionDTO.preceiptno      = Convert.ToString(dr["receipt_no"]);
                        objShareTransactionDTO.preceivedamount = Convert.ToDecimal(dr["received_amount"]);
                        objShareTransactionDTO.pmodeofreceipt  = Convert.ToString(dr["mode_of_receipt"]);
                        lstShareTransaction.Add(objShareTransactionDTO);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(lstShareTransaction);
        }
예제 #18
0
 public List <instalmentdatedetails> getinstalmentsdateslist(string ConnectionString, Int64 Loanid)
 {
     loaninstalmentdatedetails = new List <instalmentdatedetails>();
     try
     {
         using (NpgsqlDataReader dr = NPGSqlHelper.ExecuteReader(ConnectionString, CommandType.Text, "select * from TBLMSTLOANINSTALLMENTDATECONFIG where loanid=" + Loanid + " "))
         {
             while (dr.Read())
             {
                 instalmentdatedetails objinstalmentsdateslist = new instalmentdatedetails();
                 // objinstalmentsdateslis.pLoantypeid = Convert.ToInt32(dr["loantypeid"]);
                 objinstalmentsdateslist.pTypeofInstalmentDay = dr["typeofinstallmentday"].ToString();
                 objinstalmentsdateslist.pDisbursefromday     = Convert.ToInt32(dr["disbursefromday"]);
                 objinstalmentsdateslist.pDisbursetoday       = Convert.ToInt32(dr["Disbursetoday"]);
                 objinstalmentsdateslist.pInstalmentdueday    = Convert.ToInt32(dr["installmentdueday"]);
                 objinstalmentsdateslist.pInstalmentdueday    = Convert.ToInt32(dr["installmentdueday"]);
                 loaninstalmentdatedetails.Add(objinstalmentsdateslist);
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return(loaninstalmentdatedetails);
 }
예제 #19
0
        public DataSet TableGenerateReports(DateTime fromdate, DateTime todate, string tablename)
        {
            DataSet ds     = new System.Data.DataSet();
            string  strqry = string.Empty;

            try
            {
                if (tablename == "0")
                {
                    strqry = "select tableid,tablesname,sectionname,round(amt,2) as amt,round(dis,2)as dis,round(tax,2) as tax,((amt-dis)+tax) as saleofamt from(select vw.tableid as tableid,tablesname,tab.sectionname as sectionname,sum(vw.amount) as amt,sum(vw.itemdicount) as dis,sum(vw.numservicetaxvale +vw.numservicechargevale) as tax from vwitemdiscountdetails vw join tabpostablesandcoversmst tab on vw.tableid=tab.tablesname where vw.billdate between '" + FormatDate(fromdate.ToString("dd/MM/yyyy")) + "' and '" + FormatDate(todate.ToString("dd/MM/yyyy")) + "' group by vw.tableid,tablesname,tab.sectionname) x  ";
                }
                else
                {
                    strqry = "select tableid,tablesname,sectionname,round(amt,2) as amt,round(dis,2)as dis,round(tax,2) as tax,((amt-dis)+tax) as saleofamt from(select vw.tableid as tableid,tablesname,tab.sectionname as sectionname,sum(vw.amount) as amt,sum(vw.itemdicount) as dis,sum(vw.numservicetaxvale +vw.numservicechargevale) as tax from vwitemdiscountdetails vw join tabpostablesandcoversmst tab on vw.tableid=tab.tablesname where vw.billdate between '" + FormatDate(fromdate.ToString("dd/MM/yyyy")) + "' and '" + FormatDate(todate.ToString("dd/MM/yyyy")) + "' and tab.tableid='" + tablename + "'  group by vw.tableid,tablesname,tab.sectionname) x  ";
                }
                ds = NPGSqlHelper.ExecuteDataset(NPGSqlHelper.SQLConnString, CommandType.Text, strqry);
            }
            catch (Exception ex)
            {
                EventLogger.WriteToErrorLog(ex, "BillEdit");
                throw ex;
            }


            return(ds);
        }
예제 #20
0
        public int checkInsertLoanNameandCodeDuplicates(string checkparamtype, string loanname, string loancode, Int64 loanid, string connectionstring)
        {
            int count = 0;

            try
            {
                if (checkparamtype.ToUpper() == "LOANNAME")
                {
                    if (string.IsNullOrEmpty(loanid.ToString()) || loanid == 0)
                    {
                        count = Convert.ToInt32(NPGSqlHelper.ExecuteScalar(connectionstring, CommandType.Text, "select count(*) from tblmstloans where upper(loanname)='" + ManageQuote(loanname.Trim().ToUpper()) + "'"));
                    }
                    else
                    {
                        count = Convert.ToInt32(NPGSqlHelper.ExecuteScalar(connectionstring, CommandType.Text, "select count(*) from tblmstloans where upper(loanname)='" + ManageQuote(loanname.Trim().ToUpper()) + "' and loanid!=" + loanid + ";"));
                    }
                }
                else
                {
                    if (string.IsNullOrEmpty(loanid.ToString()) || loanid == 0)
                    {
                        count = Convert.ToInt32(NPGSqlHelper.ExecuteScalar(connectionstring, CommandType.Text, "select count(*) from tblmstloans where upper(loancode)='" + ManageQuote(loancode.Trim().ToUpper()) + "'"));
                    }
                    else
                    {
                        count = Convert.ToInt32(NPGSqlHelper.ExecuteScalar(connectionstring, CommandType.Text, "select count(*) from tblmstloans where upper(loancode)='" + ManageQuote(loancode.Trim().ToUpper()) + "' and loanid!=" + loanid + ";"));
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(count);
        }
예제 #21
0
        public DataSet BillwiseReport(DateTime fromdate, DateTime todate, string billno)
        {
            DataSet ds     = new System.Data.DataSet();
            string  strqry = string.Empty;

            try
            {
                if (billno == "ALL")
                {
                    //strqry = "select billno,billdate,vchbillno,tablesname,totalbillamount,replace(vchbillno ,'B','')::int as ordernumber,numservicetaxvale,numservicechargevale,itemdicount as totaldiscount,vchhostname,round((totalbillamount+numservicetaxvale+numservicechargevale-itemdicount),2) as withtaxsale,round((totalbillamount+numservicetaxvale+numservicechargevale-itemdicount),0) as Roundedsale from(select  billno,billdate,vchbillno,tablesname,sum(amount) as totalbillamount,sum(coalesce(itemdicount,0)) as itemdicount,sum(coalesce(numservicetaxvale,0)) as numservicetaxvale,sum(coalesce(numservicechargevale,0)) as numservicechargevale,vchhostname from vwitemdiscountdetails vw join tabpostablesandcoversmst tab on vw.tableid=tab.tableid  where billdate between '" + FormatDate(fromdate.ToString("dd/MM/yyyy")) + "' and '" + FormatDate(todate.ToString("dd/MM/yyyy")) + "' group by billno,billdate,vchbillno,tablesname,totalbillamount,vchhostname ) g order by ordernumber;";
                    strqry = "select billno,billdate,vchbillno,tablesname,totalbillamount,numservicetaxvale,numservicechargevale,itemdicount as totaldiscount,vchhostname,round((totalbillamount+numservicetaxvale+numservicechargevale-itemdicount),2) as withtaxsale,round((totalbillamount+numservicetaxvale+numservicechargevale-itemdicount),0) as Roundedsale from(select  billno,billdate,vchbillno,tablesname,sum(amount) as totalbillamount,sum(coalesce(itemdicount,0)) as itemdicount,sum(coalesce(numservicetaxvale,0)) as numservicetaxvale,sum(coalesce(numservicechargevale,0)) as numservicechargevale,vchhostname from vwitemdiscountdetails vw join tabpostablesandcoversmst tab on vw.tableid=tab.tablesname  where billdate between '" + FormatDate(fromdate.ToString("dd/MM/yyyy")) + "' and '" + FormatDate(todate.ToString("dd/MM/yyyy")) + "' group by billno,billdate,vchbillno,tablesname,totalbillamount,vchhostname ) g order by billno;";
                }
                else
                {
                    strqry = "select * from(select billno,billdate,vchbillno,tablesname,totalbillamount,numservicetaxvale,numservicechargevale,itemdicount as totaldiscount,vchhostname,round((totalbillamount+numservicetaxvale+numservicechargevale-itemdicount),2) as withtaxsale,round((totalbillamount+numservicetaxvale+numservicechargevale-itemdicount),0) as Roundedsale from(select  billno,billdate,vchbillno,tablesname,sum(amount) as totalbillamount,sum(coalesce(itemdicount,0)) as itemdicount,sum(coalesce(numservicetaxvale,0)) as numservicetaxvale,sum(coalesce(numservicechargevale,0)) as numservicechargevale,vchhostname from vwitemdiscountdetails vw join tabpostablesandcoversmst tab on vw.tableid=tab.tablesname  where billdate between '" + FormatDate(fromdate.ToString("dd/MM/yyyy")) + "' and '" + FormatDate(todate.ToString("dd/MM/yyyy")) + "' group by billno,billdate,vchbillno,tablesname,totalbillamount,vchhostname ) g  order by billno)x where vchbillno='" + billno + "';";
                }
                //string strqry = "select DISTINCT billno,billdate,vchbillno,tablesname,totalbillamount,replace(vchbillno ,'B','')::int as ordernumber,numservicetaxvale,totaldiscount,vchhostname,round((totalbillamount+numservicetaxvale),2) as withtaxsale,round((totalbillamount+numservicetaxvale),0) as Roundedsale from vwitemdiscountdetails vw join tabpostablesandcoversmst tab on vw.tableid=tab.tableid  where billdate between '" + FormatDate(fromdate.ToString("dd/MM/yyyy")) + "' and '" + FormatDate(todate.ToString("dd/MM/yyyy")) + "' order by ordernumber;";
                ds = NPGSqlHelper.ExecuteDataset(NPGSqlHelper.SQLConnString, CommandType.Text, strqry);
            }
            catch (Exception ex)
            {
                EventLogger.WriteToErrorLog(ex, "BillWise Report");
                throw ex;
            }
            return(ds);
        }
        public async Task <List <shareconfigDetails> > GetSharconfigdetails(long shareconfigid, string Applicanttype, string ConnectionString)
        {
            List <shareconfigDetails> lstShareconfigdetails = new List <shareconfigDetails>();

            await Task.Run(() =>
            {
                try
                {
                    using (NpgsqlDataReader dr = NPGSqlHelper.ExecuteReader(ConnectionString, CommandType.Text, "select shareconfigid,sharename,applicanttype,facevalue,minshares,maxshares from  tblmstshareconfigdetails where shareconfigid =" + shareconfigid + " and applicanttype='" + ManageQuote(Applicanttype) + "' and statusid=" + Convert.ToInt32(Status.Active) + ";"))
                    {
                        while (dr.Read())
                        {
                            shareconfigDetails objshareconfigDetails = new shareconfigDetails();
                            objshareconfigDetails.pShareconfigid     = Convert.ToInt64(dr["shareconfigid"]);
                            objshareconfigDetails.pSharename         = Convert.ToString(dr["sharename"]);
                            objshareconfigDetails.pApplicanttype     = Convert.ToString(dr["applicanttype"]);
                            objshareconfigDetails.pFacevalue         = Convert.ToInt64(dr["facevalue"]);
                            objshareconfigDetails.pMinshare          = Convert.ToInt64(dr["minshares"]);
                            objshareconfigDetails.pMaxshare          = Convert.ToInt64(dr["maxshares"]);
                            lstShareconfigdetails.Add(objshareconfigDetails);
                        }
                    }
                }
                catch (Exception)
                {
                    throw;
                }
            });

            return(lstShareconfigdetails);
        }
예제 #23
0
        public DataSet ItemConsumptionSaleReport(DateTime fromdate, DateTime todate, string department)
        {
            DataSet ds     = new System.Data.DataSet();
            string  strqry = string.Empty;

            try
            {
                if (department == "0")
                {
                    strqry = "select vw.itemid,vw.itemname,sum(vw.itemqty) as itemqty,ti.departmentname from vwitemdiscountdetails vw join tabpositemmst ti on vw.itemid=ti.itemid where billdate between '" + FormatDate(fromdate.ToString("dd/MM/yyyy")) + "' and '" + FormatDate(todate.ToString("dd/MM/yyyy")) + "' group by vw.itemid,vw.itemname,ti.departmentname order by vw.itemid;";
                    //  string strqry = "select x.*,y.itemid as itemid2,y.itemname as itemname2,y.itemqty as itemqty2,y.departmentname as departmentname2 from (select Row_Number() OVER(order  BY departmentname) as rowno,itemid,itemname,itemqty,departmentname,Rowid  from (select * from (select Row_Number() OVER(order  BY ti.departmentname) AS Rowid ,vw.itemid,vw.itemname,sum(vw.itemqty) as itemqty,ti.departmentname from vwitemdiscountdetails vw join tabpositemmst ti on vw.itemid=ti.itemid where billdate between '" + FormatDate(fromdate.ToString("dd/MM/yyyy")) + "' and '" + FormatDate(todate.ToString("dd/MM/yyyy")) + "' group by vw.itemid,vw.itemname,ti.departmentname )a where Rowid % 2=1)x)x full join (select Row_Number() OVER(order  BY departmentname)as rowno,itemid,itemname,itemqty,departmentname,Rowid  from ( select * from (select Row_Number() OVER(order  BY ti.departmentname) AS Rowid ,vw.itemid,vw.itemname,sum(vw.itemqty) as itemqty,ti.departmentname from vwitemdiscountdetails vw join tabpositemmst ti on vw.itemid=ti.itemid where billdate between '" + FormatDate(fromdate.ToString("dd/MM/yyyy")) + "' and '" + FormatDate(todate.ToString("dd/MM/yyyy")) + "' group by vw.itemid,vw.itemname,ti.departmentname )b where Rowid % 2=0)z)y on x.rowno=y.rowno and x.departmentname=y.departmentname";
                }
                else
                {
                    strqry = "select vw.itemid,vw.itemname,sum(vw.itemqty) as itemqty,ti.departmentname from vwitemdiscountdetails vw join tabpositemmst ti on vw.itemid=ti.itemid where departmentid='" + department + "' and billdate between '" + FormatDate(fromdate.ToString("dd/MM/yyyy")) + "' and '" + FormatDate(todate.ToString("dd/MM/yyyy")) + "' group by vw.itemid,vw.itemname,ti.departmentname order by vw.itemid;";
                }
                ds = NPGSqlHelper.ExecuteDataset(NPGSqlHelper.SQLConnString, CommandType.Text, strqry);
            }
            catch (Exception ex)
            {
                EventLogger.WriteToErrorLog(ex, "Item consumption Report");
                throw ex;
            }
            return(ds);
        }
        public List <jointdetails> GetJointMembersListInEdit(string AccountNo, string Accounttype, string ConnectionString)
        {
            var _MemberJointDetailsList = new List <jointdetails>();

            try
            {
                //Changed By Sai Mahesh 15 JAN 2021
                //using (NpgsqlDataReader dr = NPGSqlHelper.ExecuteReader(ConnectionString, CommandType.Text, "SELECT recordid, memberid,membercode,membername,contactid,contacttype,contactreferenceid from tbltransrdjointdetails  where  rdaccountno = '" + AccountNo + "' and accounttype='" + Accounttype + "' and statusid = " + Convert.ToInt32(Status.Active) + ";"))
                using (NpgsqlDataReader dr = NPGSqlHelper.ExecuteReader(ConnectionString, CommandType.Text, "select jointdetailsid, tj.memberid, membercode, membername, contactid, contacttype, contactreferenceid from tbltransjointdetails tj join tblmstmembers tm on tm.memberid = tj.memberid where accountno = '" + AccountNo + "' and accounttype='" + Accounttype + "' and tj.statusid = " + Convert.ToInt32(Status.Active) + ";"))
                {
                    while (dr.Read())
                    {
                        jointdetails _MemberJointDetails = new jointdetails
                        {
                            precordid        = Convert.ToInt64(dr["jointdetailsid"]),
                            pMemberId        = Convert.ToInt64(dr["memberid"]),
                            pMemberCode      = Convert.ToString(dr["membercode"]),
                            pMemberName      = Convert.ToString(dr["membername"]),
                            pContactid       = Convert.ToInt64(dr["contactid"]),
                            pContacttype     = Convert.ToString(dr["contacttype"]),
                            pContactrefid    = Convert.ToString(dr["contactreferenceid"]),
                            pTypeofOperation = "OLD"
                        };
                        _MemberJointDetailsList.Add(_MemberJointDetails);
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(_MemberJointDetailsList);
        }
예제 #25
0
        public DataSet BillReprintReport(string BillNumber, string Billtype)
        {
            DataSet ds = new System.Data.DataSet();

            try
            {
                string strqry = "select * from vwbillgeneration vw join tabpositemmst ti on vw.itemid=ti.itemid where vchbillno ='" + BillNumber + "';";
                //string strqry = "select billno,vchbillno,billdate,billtime,itemid,itemname,itemqty,itemrate,itemdiscount,numdiscount,numamount,numservicetaxvale,numservicechargevale,numgross,numnet from vwbillgeneration where vchbillno ='" + BillNumber + "';";
                ds = NPGSqlHelper.ExecuteDataset(NPGSqlHelper.SQLConnString, CommandType.Text, strqry);
                //if(ds.Tables[0].Rows.Count!=0)
                //{
                //    string insert = "INSERT INTO tabposbillprintdetails(vchbillno,billtype,billdate,createdby)VALUES ('"+BillNumber+"','"+Billtype+"',current_timestamp,1);";
                //     NPGSqlHelper.ExecuteScalar(NPGSqlHelper.SQLConnString, CommandType.Text, insert);

                //}
            }
            catch (Exception ex)
            {
                EventLogger.WriteToErrorLog(ex, "BillGeneration");
                throw ex;
            }


            return(ds);
        }
        public async Task <List <ShareviewDTO> > GetSharNames(string Membertype, string Applicanttype, string ConnectionString)
        {
            List <ShareviewDTO> lstShareviewDTO = new List <ShareviewDTO>();

            await Task.Run(() =>
            {
                try
                {
                    using (NpgsqlDataReader dr = NPGSqlHelper.ExecuteReader(ConnectionString, CommandType.Text, "select distinct shareconfigid,sharename from tblmstshareconfigdetails where membertype='" + ManageQuote(Membertype) + "' and applicanttype='" + ManageQuote(Applicanttype) + "' and statusid=" + Convert.ToInt32(Status.Active) + ";"))
                    {
                        while (dr.Read())
                        {
                            ShareviewDTO ShareviewDTO   = new ShareviewDTO();
                            ShareviewDTO.pshareconfigid = Convert.ToInt64(dr["shareconfigid"]);
                            ShareviewDTO.psharename     = Convert.ToString(dr["sharename"]);
                            lstShareviewDTO.Add(ShareviewDTO);
                        }
                    }
                }
                catch (Exception)
                {
                    throw;
                }
            });

            return(lstShareviewDTO);
        }
        public List <InsurenceConfigViewDTO> GetInsurenceViewDetails(string ConnectionString)
        {
            List <InsurenceConfigViewDTO> lstInsurenceView = new List <InsurenceConfigViewDTO>();

            try
            {
                using (NpgsqlDataReader dr = NPGSqlHelper.ExecuteReader(ConnectionString, CommandType.Text, "select insuranceschemeconfigid,insuranceschemename,insuranceschemecode,companycode,branchcode,series,serieslength,insuranceschemenamecode,statusid from tblmstinsuranceconfig where statusid = " + Convert.ToInt32(Status.Active) + ";"))
                {
                    while (dr.Read())
                    {
                        InsurenceConfigViewDTO objlstInsurenceView = new InsurenceConfigViewDTO();
                        objlstInsurenceView.pInsurenceconfigid = Convert.ToInt64(dr["insuranceschemeconfigid"]);
                        objlstInsurenceView.pInsurencename     = dr["insuranceschemename"].ToString();
                        objlstInsurenceView.pInsurencenamecode = dr["insuranceschemenamecode"].ToString();
                        if (Convert.ToInt32(dr["statusid"]) == Convert.ToInt32(Status.Active))
                        {
                            objlstInsurenceView.pstatus = true;
                        }
                        if (Convert.ToInt32(dr["statusid"]) == Convert.ToInt32(Status.Inactive))
                        {
                            objlstInsurenceView.pstatus = false;
                        }
                        lstInsurenceView.Add(objlstInsurenceView);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(lstInsurenceView);
        }
예제 #28
0
        public List <MemberreceiptViewDTO> GetMemberReceiptView(string FromDate, string Todate, string Connectionstring)
        {
            List <MemberreceiptViewDTO> lstmemberReceiptView = new List <MemberreceiptViewDTO>();

            try
            {
                using (NpgsqlDataReader dr = NPGSqlHelper.ExecuteReader(Connectionstring, CommandType.Text, "select memberid, membername, membercode, membertypeid, membertype, contactid, contacttype, contactreferenceid,to_char(receipt_date, 'dd/Mon/yyyy') receipt_date, received_amount, mode_of_receipt, receipt_no, narration, (case when tt.clearstatus = 'R' OR tt.clearstatus = 'C' OR tt.depositstatus = 'C' then 'Cancelled' when tt.clearstatus = 'Y' then 'Cleared' when tt.clearstatus IS NULL then 'Cleared' else 'Un-Cleared' end)as ChequeStatus from Member_receipt MR join tblmstmembers TM on TM.memberid = MR.member_id left join tbltransreceiptreference TT on TT.receiptid = MR.receipt_no where MR.status = true and receipt_date between '" + FormatDate(FromDate) + "' and '" + FormatDate(Todate) + "' order by memberid desc;"))
                {
                    while (dr.Read())
                    {
                        MemberreceiptViewDTO objMemberReceipt = new MemberreceiptViewDTO();
                        objMemberReceipt.pmemberid           = Convert.ToInt64(dr["memberid"]);
                        objMemberReceipt.pmembername         = Convert.ToString(dr["membername"]);
                        objMemberReceipt.pmembercode         = Convert.ToString(dr["membercode"]);
                        objMemberReceipt.pmembertypeid       = Convert.ToInt64(dr["membertypeid"]);
                        objMemberReceipt.pmembertype         = Convert.ToString(dr["membertype"]);
                        objMemberReceipt.pcontactid          = Convert.ToInt64(dr["contactid"]);
                        objMemberReceipt.pcontacttype        = Convert.ToString(dr["contacttype"]);
                        objMemberReceipt.pcontactreferenceid = Convert.ToString(dr["contactreferenceid"]);
                        objMemberReceipt.preceiptdate        = dr["receipt_date"] == DBNull.Value ? null : Convert.ToDateTime(dr["receipt_date"]).ToString("dd/MM/yyyy");
                        objMemberReceipt.preceivedamount     = Convert.ToDecimal(dr["received_amount"]);
                        objMemberReceipt.pmodeofreceipt      = Convert.ToString(dr["mode_of_receipt"]);
                        objMemberReceipt.preceiptno          = Convert.ToString(dr["receipt_no"]);
                        objMemberReceipt.pnarration          = Convert.ToString(dr["narration"]);
                        objMemberReceipt.pChequeStatus       = Convert.ToString(dr["ChequeStatus"]);
                        lstmemberReceiptView.Add(objMemberReceipt);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(lstmemberReceiptView);
        }
        public InsuranceschemeandcodeCount GetInsuranceNameCount(Int64 Insuranceid, string InsuranceName, string InsuranceCode, string ConnectionString)
        {
            InsuranceschemeandcodeCount _InsuranceschemeandcodeCount = new InsuranceschemeandcodeCount();

            try
            {
                if (Insuranceid == 0)
                {
                    _InsuranceschemeandcodeCount.pSchemeCount = Convert.ToInt32(NPGSqlHelper.ExecuteScalar(ConnectionString, CommandType.Text, "select count(*) from tblmstinsuranceconfig where upper(InsuranceSchemeName)='" + ManageQuote(InsuranceName).ToUpper() + "' and statusid=" + Convert.ToInt32(Status.Active) + ";"));

                    _InsuranceschemeandcodeCount.pSchemeCodeCount = Convert.ToInt32(NPGSqlHelper.ExecuteScalar(ConnectionString, CommandType.Text, "select count(*) from tblmstinsuranceconfig where upper(insuranceschemecode)='" + ManageQuote(InsuranceCode).ToUpper() + "' and statusid=" + Convert.ToInt32(Status.Active) + ";"));
                }
                else
                {
                    _InsuranceschemeandcodeCount.pSchemeCount = Convert.ToInt32(NPGSqlHelper.ExecuteScalar(ConnectionString, CommandType.Text, "select count(*) from tblmstinsuranceconfig where upper(InsuranceSchemeName)='" + ManageQuote(InsuranceName).ToUpper() + "' and insuranceschemeconfigid <> " + Insuranceid + " and statusid=" + Convert.ToInt32(Status.Active) + ";"));

                    _InsuranceschemeandcodeCount.pSchemeCodeCount = Convert.ToInt32(NPGSqlHelper.ExecuteScalar(ConnectionString, CommandType.Text, "select count(*) from tblmstinsuranceconfig where upper(insuranceschemecode)='" + ManageQuote(InsuranceCode).ToUpper() + "' and insuranceschemeconfigid <> " + Insuranceid + " and statusid=" + Convert.ToInt32(Status.Active) + ";"));
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(_InsuranceschemeandcodeCount);
        }
예제 #30
0
        public List <BankInformationDTO> ViewBankInformationDetails(string con)
        {
            List <BankInformationDTO> lstBankInformation = new List <BankInformationDTO>();

            try
            {
                using (NpgsqlDataReader dr = NPGSqlHelper.ExecuteReader(con, CommandType.Text, "select recordid,bankname,accountnumber,accountname,statusname,isdebitcardapplicable,isupiapplicable from tblmstbank t join tblmststatus ts on t.statusid=ts.statusid  ;"))
                {
                    while (dr.Read())
                    {
                        BankInformationDTO obj = new BankInformationDTO();
                        obj.pRecordid              = Convert.ToInt64(dr["recordid"]);
                        obj.pBankname              = Convert.ToString(dr["bankname"]);
                        obj.pAccountnumber         = Convert.ToString(dr["accountnumber"]);
                        obj.pAccountname           = Convert.ToString(dr["accountname"]);
                        obj.pStatusname            = Convert.ToString(dr["statusname"]);
                        obj.pIsdebitcardapplicable = Convert.ToBoolean(dr["isdebitcardapplicable"]);
                        obj.pIsupiapplicable       = Convert.ToBoolean(dr["isupiapplicable"]);
                        lstBankInformation.Add(obj);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(lstBankInformation);
        }