public void FillCompanyDllAction(int accessLevel)
        {
            SQLHandler sql = new SQLHandler();

            if ((int)Enums.AccessLevel.CompanyAdmin == accessLevel)
            {
                dt = sql.ExecuteSqlReterieve(SqlCache.GetSql("GetUserPharmaCompany"));
            }
            else if ((int)Enums.AccessLevel.PharmacyAdmin == accessLevel || (int)Enums.AccessLevel.Operator == accessLevel)
            {
                dt = sql.ExecuteSqlReterieve(SqlCache.GetSql("GetUserPharmacy"));
            }

            MessageCollection.copyFrom(sql.Messages);

            if (dt == null || dt.Rows.Count <= 0)
            {
                MessageCollection.addMessage(new Message()
                {
                    Context      = "UsersHandler",
                    ErrorCode    = ErrorCache.RecordsNotFound,
                    ErrorMessage = ErrorCache.getErrorMessage(ErrorCache.RecordsNotFound) + " in Company/Pharmacy Table",
                    isError      = true,
                    LogType      = Enums.LogType.Exception,
                    WebPage      = "Users"
                });
            }
        }
Beispiel #2
0
        public void GetMedicineAgainstQRCode(string qrcode, DataTable viewData, int pharmacyid)
        {
            SQLHandler sql = new SQLHandler(new ArrayList()
            {
                qrcode
            });

            dt = sql.ExecuteSqlReterieve(SqlCache.GetSql("GetMedicinesForQRCode"));
            MessageCollection.copyFrom(sql.Messages);

            if (dt == null || dt.Rows.Count <= 0)
            {
                MessageCollection.addMessage(new Message()
                {
                    Context      = "MedicineHandler",
                    ErrorCode    = ErrorCache.RecordsNotFound,
                    ErrorMessage = ErrorCache.getErrorMessage(ErrorCache.RecordsNotFound),
                    isError      = true,
                    LogType      = Enums.LogType.Exception,
                    WebPage      = "Medicine"
                });
            }
            Decrementquantity(dt.Rows[0].Field <int>("pharmacyid"), dt.Rows[0].Field <int>("medicineid"));
            viewData.Rows.Add(dt.Rows[0]);
            dt = viewData;
        }
Beispiel #3
0
        public override void DoAction()
        {
            ArrayList Params = new ArrayList()
            {
                userName,
                password
            };

            SQLHandler sql = new SQLHandler(Params);

            dt = sql.ExecuteSqlReterieve(SqlCache.GetSql("UserLogin"));

            MessageCollection.copyFrom(sql.Messages);
            if (!MessageCollection.isErrorOccured)
            {
                if (dt != null && dt.Rows.Count > 0)
                {
                    Session[Enums.SessionName.UserDetails.ToString()] = dt;
                    accessLevel = Convert.ToInt16(dt.Rows[0]["accesslevel"].ToString());
                }
                else if (dt == null || dt.Rows.Count <= 0)
                {
                    MessageCollection.addMessage(new Message()
                    {
                        Context      = "LoginHandler",
                        ErrorCode    = ErrorCache.LoginFailed,
                        ErrorMessage = ErrorCache.getErrorMessage(ErrorCache.LoginFailed),
                        isError      = true,
                        LogType      = Enums.LogType.Exception,
                        WebPage      = "Login"
                    });
                }
            }
        }
        internal void DoSqlUpdateAction(string token, string EmailFrom)
        {
            ArrayList Params = new ArrayList()
            {
                token,
                EmailFrom
            };

            SQLHandler sqlHandler = new SQLHandler(Params);
            DataTable  dt         = sqlHandler.ExecuteSqlReterieve(SqlCache.GetSql("CheckToken"));

            if (dt != null && dt.Rows.Count > 0)
            {
                if (!Convert.ToBoolean(dt.Rows[0]["isUsed"]))
                {
                    sqlHandler = new SQLHandler(Params);
                    sqlHandler.ExecuteNonQuery(SqlCache.GetSql("UpdateToken"));
                }
                else
                {
                    messageCollection.addMessage(
                        new Message()
                    {
                        Context      = "MailingHandler",
                        ErrorCode    = 1,
                        ErrorMessage = "The Token is already Used",
                        isError      = true,
                        LogType      = Enums.LogType.Exception
                    });
                }
            }
            else
            {
                messageCollection.addMessage(
                    new Message()
                {
                    Context      = "MailingHandler",
                    ErrorCode    = 1,
                    ErrorMessage = "There is no token with that signature",
                    isError      = true,
                    LogType      = Enums.LogType.Exception
                });
            }
        }
Beispiel #5
0
        public override void DoFillGridAction()
        {
            SQLHandler sql = new SQLHandler();

            dt = sql.ExecuteSqlReterieve(SqlCache.GetSql("GetMedicines"));
            MessageCollection.copyFrom(sql.Messages);

            if (dt == null || dt.Rows.Count <= 0)
            {
                MessageCollection.addMessage(new Message()
                {
                    Context      = "MedicineHandler",
                    ErrorCode    = ErrorCache.RecordsNotFound,
                    ErrorMessage = ErrorCache.getErrorMessage(ErrorCache.RecordsNotFound),
                    isError      = true,
                    LogType      = Enums.LogType.Exception,
                    WebPage      = "Medicine"
                });
            }
        }
        public override void DoFillBackPanelAction(int ID)
        {
            SQLHandler sql = new SQLHandler(new ArrayList()
            {
                ID
            });

            dt = sql.ExecuteSqlReterieve(SqlCache.GetSql("GetUser"));
            MessageCollection.copyFrom(sql.Messages);

            if (dt == null || dt.Rows.Count <= 0)
            {
                MessageCollection.addMessage(new Message()
                {
                    Context      = "UsersHandler",
                    ErrorCode    = ErrorCache.RecordsNotFound,
                    ErrorMessage = ErrorCache.getErrorMessage(ErrorCache.RecordsNotFound),
                    isError      = true,
                    LogType      = Enums.LogType.Exception,
                    WebPage      = "Users"
                });
            }
        }
Beispiel #7
0
        public DataTable GetMedicine(PharmacyInventoryModel model)
        {
            SQLHandler sql = new SQLHandler(new ArrayList()
            {
                model.PharmacyID, model.MedicineID
            });

            dt = sql.ExecuteSqlReterieve(SqlCache.GetSql("GetPOSMedicine"));
            MessageCollection.copyFrom(sql.Messages);

            if (dt == null || dt.Rows.Count <= 0)
            {
                MessageCollection.addMessage(new Message()
                {
                    Context      = "PharmacyPOSHandler",
                    ErrorCode    = ErrorCache.RecordsNotFound,
                    ErrorMessage = ErrorCache.getErrorMessage(ErrorCache.RecordsNotFound),
                    isError      = true,
                    LogType      = Enums.LogType.Exception,
                    WebPage      = "PharmacyPOS"
                });
            }
            return(dt);
        }