Esempio n. 1
0
        protected void Get()
        {
            Util_BLL util = new Util_BLL();

            if (!util.IsDate(txtFromDate.Text))
            {
                lblError.Text    = "Please Enter Valid Date !";
                lblError.Visible = true;
                return;
            }
            lblError.Text    = string.Empty;
            lblError.Visible = false;

            if (txtFromDate.Text == "")
            {
                txtFromDate.Text = Util_BLL.MIN_DATE;
            }

            rvAttendance.LocalReport.Refresh();
        }
Esempio n. 2
0
        public List <User> GetMatchedUsers(DBSite site, string value_to_search)
        {
            List <User> users = new List <User>();
            User        user  = null;

            string qry = " SELECT "
                         + " UserInfoId"
                         + ", UserName"
                         + ", Email"
                         + ", SenderID"
                         + ", SMSUser"
                         + ", SMSPassword"
                         + ", SMSDelivery"
                         + ", UserPassword"
                         + ", CreationDate"
                         + ", AmountPaid"
                         + ", StartDate"
                         + ", EndDate"
                         + ", Address"
                         + ", City"
                         + ", Country"
                         + ", Phone"
                         + ", Mobile"
                         + ", TinNumber"
                         + ", SalesTaxNumber"
                         + ", CSTNumber"
                         + ", UserType"
                         + ", Remarks";

            qry += " FROM tblUserInfo  ";
            qry += Util_BLL.GetUserWhereCondition(Util_BLL.User);

            // qry += " WHERE ";
            //qry += " WHERE UserID = " + User.userID + " AND  FYear= " + User.fYear + " AND ";

            qry += "AND (( UserName LIKE '%" + value_to_search + "%' ) OR";
            qry += " ( Email LIKE '%" + value_to_search + "%' ) OR";
            qry += " ( Address LIKE '%" + value_to_search + "%' ) OR";
            qry += " ( City LIKE '%" + value_to_search + "%' ) OR";
            qry += " ( Country LIKE '%" + value_to_search + "%' ) OR";
            qry += " ( Phone LIKE '%" + value_to_search + "%' ) OR";

            qry += " ( Mobile LIKE '%" + value_to_search + "%' ) OR";
            qry += " ( TinNumber LIKE '%" + value_to_search + "%' ) OR";
            qry += " ( SalesTaxNumber LIKE '%" + value_to_search + "%' ) OR";


            if (util.IsDate(value_to_search))
            {
                qry += " ( CreationDate = '" + value_to_search + "' ) OR";
                qry += " ( EndDate = '" + value_to_search + "' ) OR";
                qry += " ( StartDate = '" + value_to_search + "' ) OR";
            }

            if (util.IsNumber(value_to_search))
            {
                qry += " ( AmountPaid = '" + value_to_search + "' ) OR ";
            }
            qry += " ( CSTNumber LIKE '%" + value_to_search + "%' ) ";
            qry += ")";

            DataTable dt = site.ExecuteSelect(qry);

            foreach (DataRow row in dt.Rows)
            {
                user = new User();

                user.UserId      = util.CheckNullInt(row["UserInfoId"]);
                user.UserName    = util.CheckNull(row["UserName"]);
                user.EmailId     = util.CheckNull(row["Email"]);
                user.SenderId    = util.CheckNull(row["SenderID"]);
                user.SMSUser     = util.CheckNull(row["SMSUser"]);
                user.SMSPassword = util.CheckNull(row["SMSPassword "]);
                user.SMSDelivery = util.CheckNullInt(row["SMSDelivery"]);

                user.UserPassword   = util.CheckNull(row["UserPassword"]);
                user.AmountPaid     = util.CheckNullDecimal(row["AmountPaid"]);
                user.CreationDate   = ((DateTime)row["CreationDate"]).ToShortDateString();
                user.StartDate      = ((DateTime)row["StartDate"]).ToShortDateString();
                user.EndDate        = ((DateTime)row["EndDate"]).ToShortDateString();
                user.Address        = util.CheckNull(row["Address"]);
                user.City           = util.CheckNull(row["City"]);
                user.Country        = util.CheckNull(row["Country"]);
                user.Phone          = util.CheckNull(row["Phone"]);
                user.Mobile         = util.CheckNull(row["Mobile"]);
                user.TinNumber      = util.CheckNull(row["PinNumber"]);
                user.SalesTaxNumber = util.CheckNull(row["SalesTaxNumber"]);
                user.CSTNumber      = util.CheckNull(row["CSTNumber"]);
                user.UserType       = util.CheckNullInt(row["UserType"]);
                user.Remarks        = util.CheckNull(row["Remarks"]);


                users.Add(user);
            }

            return(users);
        }
Esempio n. 3
0
        public List <StockMovement> GetStore(DBSite site, string search_term, int product_ledger_number = 0)
        {
            List <StockMovement> stock_list = new List <StockMovement>();
            //444
            string qry = " SELECT TOP 20 "

                         + " ProductLedgerNumber "
                         + ", TransactionId"
                         + ",  TransactionName "
                         + ",  Particulars "
                         + ", BillDate "
                         + ", SubUserID "
                         + ", SubUserName "
                         + ", CreatedAt "

                         + " FROM ( "


                         + " SELECT  "
                         + " Distinct ProductLedgerNumber "
                         + ", SourceId TransactionId"
                         + ",  TransactionName "
                         + ",  Particulars "
                         + ", BillDate "
                         + ", pldg.SubUserID "
                         + ", SubUserName "
                         + ", DATEADD(dd, 0, DATEDIFF(dd, 0, pldg.CreatedAt)) as createdAt ";

            qry += " FROM "
                   + " tblProductLedger as pldg "
                   + " LEFT OUTER JOIN tblStockTransactionMaster stm ON stm.TransactionId = pldg.sourceID "
                   + " LEFT OUTER JOIN tblSubUser sub ON sub.SubUserID = pldg.SubUserID ";

            qry += " WHERE "
                   + " pldg.UserId = " + Util_BLL.User.UserId + " AND "
                   + " pldg.FYear = " + Util_BLL.User.fYear;
            // + " AND pldg.SourceId = " + TransactionType.StockMovement;

            if (product_ledger_number != 0)
            {
                qry += " AND pldg.ProductLedgerNumber = " + product_ledger_number;
            }

            if (search_term.Length > 0)
            {
                qry += " AND (TransactionName like '%" + search_term + "%'";
                qry += " OR Particulars like '%" + search_term + "%'";
                qry += " OR pldg.ProductLedgerNumber  like '%" + search_term + "%'";

                if (util.IsDate(search_term))
                {
                    qry += " OR BillDate = '" + search_term + "'";
                }
                qry += " OR SubUserName like '%" + search_term + "%')";
            }

            qry += " ) a1  ";
            qry += " ORDER BY ProductLedgerNumber DESC,  BillDate DESC";


            StockMovement stock_movement_entity = null;
            DataTable     dt  = site.ExecuteSelect(qry);
            DataRow       row = null;

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                stock_movement_entity = new StockMovement();
                List <ProductDetail> product_details = new List <ProductDetail>();


                row = dt.Rows[i];

                stock_movement_entity.ProductLedgerNumber = util.CheckNullInt(row["ProductLedgerNumber"]);
                DateTime date = Convert.ToDateTime(row["BillDate"]);
                stock_movement_entity.MovementDate      = date.ToShortDateString();
                stock_movement_entity.TransactionTypeId = util.CheckNullInt(row["TransactionId"]);
                stock_movement_entity.TransactionName   = util.CheckNull(row["TransactionName"]);
                stock_movement_entity.Narration         = util.CheckNull(row["Particulars"]);
                stock_movement_entity.SubUserName       = util.CheckNull(row["SubUserName"]);
                stock_movement_entity.CreatedDate       = Convert.ToDateTime(row["CreatedAt"]);

                product_details = this.GetProductDetailList(site, stock_movement_entity.ProductLedgerNumber);

                stock_movement_entity.ProductDetails = product_details;
                stock_list.Add(stock_movement_entity);
            }

            return(stock_list);
        }