Exemplo n.º 1
0
        public static int InsertBarCode(BarCode bc, int UserID, string latitude, string longitude, string DeviceID, string DeviceType, string Description)
        {
            int LogID = 0;
            List <SqlParameter> prams = new List <SqlParameter>();

            try
            {
                using (DbManager db = DbManager.GetDbManager())
                {
                    prams.Add(db.MakeInParam("@intBarcodeID", SqlDbType.Int, 0, bc.BarCodeID));
                    prams.Add(db.MakeInParam("@intUserID", SqlDbType.Int, 0, UserID));
                    prams.Add(db.MakeInParam("@dcmlatitude", SqlDbType.VarChar, 50, latitude));
                    prams.Add(db.MakeInParam("@dcmlongitude", SqlDbType.VarChar, 50, longitude));
                    prams.Add(db.MakeInParam("@vchDeviceID", SqlDbType.VarChar, 50, DeviceID));
                    prams.Add(db.MakeInParam("@vchDeviceType", SqlDbType.VarChar, 50, DeviceType));
                    prams.Add(db.MakeInParam("@vchDescription", SqlDbType.VarChar, 200, Description));
                    LogID = db.RunProc("Up_InsertBarCodeLog", prams.ToArray());
                }
            }
            catch (Exception ex)
            {
                LogID = 0;
                new SqlLog().InsertSqlLog(0, "BarCode.InsertBarCode", ex);
            }

            return(LogID);
        }
Exemplo n.º 2
0
        public static int Insert(BarCode bar)
        {
            int LogID = 0;
            List <SqlParameter> prams = new List <SqlParameter>();

            try
            {
                using (DbManager db = DbManager.GetDbManager())
                {
                    prams.Add(db.MakeInParam("@vchSerialNumber", SqlDbType.NVarChar, 12, bar.BarCodeNumber));
                    prams.Add(db.MakeInParam("@dtmDateCreated", SqlDbType.DateTime, 8, Convert.ToDateTime(bar.DateCreated)));
                    prams.Add(db.MakeInParam("@intOrgId", SqlDbType.Int, 4, bar.OrganizationID));
                    prams.Add(db.MakeInParam("@Image", SqlDbType.VarBinary, -1, bar.Image));

                    LogID = db.RunProc("up_InsertBarcode", prams.ToArray());
                }
            }
            catch (Exception ex)
            {
                LogID = 0;
                new SqlLog().InsertSqlLog(0, "BarCode.Insert", ex);
            }
            return(LogID);
        }
Exemplo n.º 3
0
        public static int Insert(BarCode bar)
        {
            int LogID = 0;
            List<SqlParameter> prams = new List<SqlParameter>();
            try
            {
                using (DbManager db = DbManager.GetDbManager())
                {
                    prams.Add(db.MakeInParam("@vchSerialNumber", SqlDbType.NVarChar, 12, bar.BarCodeNumber));
                    prams.Add(db.MakeInParam("@dtmDateCreated", SqlDbType.DateTime, 8, Convert.ToDateTime(bar.DateCreated)));
                    prams.Add(db.MakeInParam("@intOrgId", SqlDbType.Int, 4, bar.OrganizationID));
                    prams.Add(db.MakeInParam("@Image", SqlDbType.VarBinary, -1, bar.Image));

                    LogID = db.RunProc("up_InsertBarcode", prams.ToArray());
                }
            }
            catch (Exception ex)
            {
                LogID = 0;
                new SqlLog().InsertSqlLog(0, "BarCode.Insert", ex);
            }
            return LogID;
        }
Exemplo n.º 4
0
        public static int InsertBarCode(BarCode bc, int UserID, string latitude, string longitude, string DeviceID, string DeviceType, string Description)
        {
            int LogID = 0;
            List<SqlParameter> prams = new List<SqlParameter>();
            try
            {
                using (DbManager db = DbManager.GetDbManager())
                {
                    prams.Add(db.MakeInParam("@intBarcodeID", SqlDbType.Int, 0, bc.BarCodeID));
                    prams.Add(db.MakeInParam("@intUserID", SqlDbType.Int, 0, UserID));
                    prams.Add(db.MakeInParam("@dcmlatitude", SqlDbType.VarChar, 50, latitude));
                    prams.Add(db.MakeInParam("@dcmlongitude", SqlDbType.VarChar, 50, longitude));
                    prams.Add(db.MakeInParam("@vchDeviceID", SqlDbType.VarChar, 50, DeviceID));
                    prams.Add(db.MakeInParam("@vchDeviceType", SqlDbType.VarChar, 50, DeviceType));
                    prams.Add(db.MakeInParam("@vchDescription", SqlDbType.VarChar, 200, Description));
                    LogID = db.RunProc("Up_InsertBarCodeLog", prams.ToArray());
                }
            }
            catch (Exception ex)
            {
                LogID = 0;
                new SqlLog().InsertSqlLog(0, "BarCode.InsertBarCode", ex);
            }

            return LogID;
        }