Exemplo n.º 1
0
        //Added By Manju
        private decimal GetOutstandingBill(int supid)
        {
            decimal totuot = 0;

            DataRow dr = MyCommon.GetDataRowAccount("select sum(FCr) as sum from tblpendingpayablebill  where supplier='" + supid + "' and billstatus=0", "Get Oustanding Bill");

            if (dr != null)
            {
                bool resp = decimal.TryParse(dr["sum"].ToString(), out totuot);
            }

            return(totuot);
        }
Exemplo n.º 2
0
        public string GetExistBankCheques(string ChequeNo, out BankChequesDataType _ExistData)
        {
            _ExistData = new BankChequesDataType();
            MySqlCommand oSqlCommand = new MySqlCommand();
            string       sqlQuery    = "Select "
                                       + "SysID,"
                                       + "ChequeNo,"
                                       + "BankID,"
                                       + "ChOwner,"
                                       + "ChType,"
                                       + "ChDate,"
                                       + "ReceiveRaisedDate,"
                                       + "DepositDate,"
                                       + "ChStatus,"
                                       + "IsReconciled,"
                                       + "LastUser,"
                                       + "LastModiDate,"
                                       + "Amount"
                                       + " from tblcheque"
                                       + " Where 1=1 "
                                       + " and ChequeNo=@ChequeNo";

            oSqlCommand.Parameters.AddWithValue("@ChequeNo", ChequeNo);
            DataRow r = Mycommon.GetDataRowAccount(sqlQuery, oSqlCommand, "Get Exist data BankCheques");

            if (r != null)
            {
                try
                {
                    bool resp    = false;
                    int  inSysID = 0;
                    resp                = int.TryParse(r["SysID"].ToString(), out inSysID);
                    _ExistData.SysID    = inSysID;
                    _ExistData.ChequeNo = r["ChequeNo"].ToString();
                    int inBankID = 0;
                    resp = int.TryParse(r["BankID"].ToString(), out inBankID);
                    _ExistData.BankID  = inBankID;
                    _ExistData.ChOwner = r["ChOwner"].ToString();
                    int inChType = 0;
                    resp = int.TryParse(r["ChType"].ToString(), out inChType);
                    _ExistData.ChType = inChType;
                    DateTime dtChDate = new DateTime(1900, 1, 1);
                    resp = DateTime.TryParse(r["ChDate"].ToString(), out dtChDate);
                    if (resp)
                    {
                        _ExistData.ChDate = dtChDate;
                    }
                    else
                    {
                        _ExistData.ChDate = new DateTime(1900, 1, 1);
                    }
                    DateTime dtReceiveRaisedDate = new DateTime(1900, 1, 1);
                    resp = DateTime.TryParse(r["ReceiveRaisedDate"].ToString(), out dtReceiveRaisedDate);
                    if (resp)
                    {
                        _ExistData.ReceiveRaisedDate = dtReceiveRaisedDate;
                    }
                    else
                    {
                        _ExistData.ReceiveRaisedDate = new DateTime(1900, 1, 1);
                    }
                    DateTime dtDepositDate = new DateTime(1900, 1, 1);
                    resp = DateTime.TryParse(r["DepositDate"].ToString(), out dtDepositDate);
                    if (resp)
                    {
                        _ExistData.DepositDate = dtDepositDate;
                    }
                    else
                    {
                        _ExistData.DepositDate = new DateTime(1900, 1, 1);
                    }
                    int inChStatus = 0;
                    resp = int.TryParse(r["ChStatus"].ToString(), out inChStatus);
                    _ExistData.ChStatus = inChStatus;
                    int inIsReconciled = 0;
                    resp = int.TryParse(r["IsReconciled"].ToString(), out inIsReconciled);
                    _ExistData.IsReconciled = inIsReconciled;
                    _ExistData.LastUser     = r["LastUser"].ToString();
                    DateTime dtLastModiDate = new DateTime(1900, 1, 1);
                    resp = DateTime.TryParse(r["LastModiDate"].ToString(), out dtLastModiDate);
                    if (resp)
                    {
                        _ExistData.LastModiDate = dtLastModiDate;
                    }
                    else
                    {
                        _ExistData.LastModiDate = new DateTime(1900, 1, 1);
                    }
                    decimal deAmount = 0;
                    resp = decimal.TryParse(r["Amount"].ToString(), out deAmount);
                    _ExistData.Amount = deAmount;
                    return("True");
                }
                catch (Exception ex)
                {
                    return(ex.Message);
                }
            }
            else
            {
                return("data not found ");
            }
        }
Exemplo n.º 3
0
        public string GetExistObjectUserRoll(int RollID, int userID, int ObgID, out ObjectUserRollDataType _ExistData)
        {
            _ExistData = new ObjectUserRollDataType();
            MySqlCommand oSqlCommand = new MySqlCommand();
            string       sqlQuery    = "Select "
                                       + "SysID,"
                                       + "RollID,"
                                       + "userID,"
                                       + "ObgID,"
                                       + "OView,"
                                       + "OSave,"
                                       + "OUpdate,"
                                       + "Odelete,"
                                       + "OPrint,"
                                       + "OPostToApp,"
                                       + "OPostToAcc"
                                       + " from tblobguserprofile"
                                       + " Where 1=1 "
                                       + " and RollID=@RollID"
                                       + " and userID=@userID"
                                       + " and ObgID=@ObgID";

            oSqlCommand.Parameters.AddWithValue("@RollID", RollID);
            oSqlCommand.Parameters.AddWithValue("@userID", userID);
            oSqlCommand.Parameters.AddWithValue("@ObgID", ObgID);
            DataRow r = MYCommon.GetDataRowAccount(sqlQuery, oSqlCommand, "Get Exist data ObjectUserRoll");

            if (r != null)
            {
                try
                {
                    bool resp    = false;
                    int  inSysID = 0;
                    resp             = int.TryParse(r["SysID"].ToString(), out inSysID);
                    _ExistData.SysID = inSysID;
                    int inRollID = 0;
                    resp = int.TryParse(r["RollID"].ToString(), out inRollID);
                    _ExistData.RollID = inRollID;
                    int inuserID = 0;
                    resp = int.TryParse(r["userID"].ToString(), out inuserID);
                    _ExistData.userID = inuserID;
                    int inObgID = 0;
                    resp             = int.TryParse(r["ObgID"].ToString(), out inObgID);
                    _ExistData.ObgID = inObgID;
                    int inOView = 0;
                    resp             = int.TryParse(r["OView"].ToString(), out inOView);
                    _ExistData.OView = inOView;
                    int inOSave = 0;
                    resp             = int.TryParse(r["OSave"].ToString(), out inOSave);
                    _ExistData.OSave = inOSave;
                    int inOUpdate = 0;
                    resp = int.TryParse(r["OUpdate"].ToString(), out inOUpdate);
                    _ExistData.OUpdate = inOUpdate;
                    int inOdelete = 0;
                    resp = int.TryParse(r["Odelete"].ToString(), out inOdelete);
                    _ExistData.Odelete = inOdelete;
                    int inOPrint = 0;
                    resp = int.TryParse(r["OPrint"].ToString(), out inOPrint);
                    _ExistData.OPrint = inOPrint;
                    int inOPostToApp = 0;
                    resp = int.TryParse(r["OPostToApp"].ToString(), out inOPostToApp);
                    _ExistData.OPostToApp = inOPostToApp;
                    int inOPostToAcc = 0;
                    resp = int.TryParse(r["OPostToAcc"].ToString(), out inOPostToAcc);
                    _ExistData.OPostToAcc = inOPostToAcc;
                    return("True");
                }
                catch (Exception ex)
                {
                    return(ex.Message);
                }
            }
            else
            {
                return("data not found ");
            }
        }