Exemplo n.º 1
0
        /// <summary>
        /// Saves current Object Values into Database.
        /// </summary>
        /// <param name="objVisitorGP">Current VisitorGP Object.</param>
        /// <returns>Boolean value True if record is saved successfully
        /// otherwise returns 'False' indicating record is not saved.</returns>
        public static bool Save(VisitorGatePass objVisitorGP, User objCurUser)
        {
            bool flgSave;

            try
            {
                using (TransactionScope objTScope = new TransactionScope(TransactionScopeOption.RequiresNew))
                {
                    if (objVisitorGP.IsEdited || objVisitorGP.IsNew)
                    {
                        //if (IsGatePassExist(objVisitorGP))
                        //{
                        //    throw new Exception("GatePass Already Exists.");
                        //}
                        //else
                        //{
                        VisitorGatePassDAL.Save(objVisitorGP, objCurUser);
                        if (objVisitorGP.IsNew)
                        {
                            VisitorGatePassDAL.CloseAppointment(objVisitorGP);
                        }
                        //}
                    }
                    flgSave = true;
                    objTScope.Complete();
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(flgSave);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Deletes Record from Database.
        /// </summary>
        /// <param name="objVisitorGP">Object containing all data values.</param>
        /// <returns>boolean value True if Record is deleted successfully
        /// otherwise returns False.</returns>
        public static bool Delete(VisitorGatePass objVisitorGP)
        {
            bool recDel;

            recDel = VisitorGatePassDAL.Delete(objVisitorGP.DBID);
            if (recDel)
            {
                VisitorGatePassDAL.ReOpenAppointment(objVisitorGP.AppointmentNo);
            }
            return(recDel);
        }
Exemplo n.º 3
0
        public static string[] GetEmployee()
        {
            DataTable dTable;

            string[] objEmplyeeList = null;
            dTable = VisitorGatePassDAL.GetEmployee();

            if (dTable.Rows.Count > 0)
            {
                objEmplyeeList = dTable.AsEnumerable().Select(row => row.Field <string>("TOMEET")).ToArray();
            }
            return(objEmplyeeList);
        }
Exemplo n.º 4
0
        public static byte[] GetVisitorImage(long vDBID)
        {
            DataTable dTable;

            byte[] vImage = null;
            dTable = VisitorGatePassDAL.GetVisitorImage(vDBID);
            if (dTable.Rows.Count > 0)
            {
                vImage = (byte[])dTable.Rows[0]["VIMAGE"];
            }

            return(vImage);
        }
Exemplo n.º 5
0
 /// <summary>
 /// Retrieves VisitorGatePass Detail for Specified Record.
 /// </summary>
 /// <param name="dbid">Unique ID for Record in Database.</param>
 /// <returns>Object VisitorGatePass containing Data values.</returns>
 public static VisitorGatePass GetItem(int dbid)
 {
     return(VisitorGatePassDAL.GetItem(dbid));
 }
Exemplo n.º 6
0
 /// <summary>
 /// Retrieves List of GatePasses availble.
 /// </summary>
 /// <param name="strWhere">Condition for filtering the list.</param>
 /// <returns>Collection Object GatePassList.</returns>
 public static VisitorGatePassList GetList(string strWhere, DateTime vwDate, bool flgShowAll)
 {
     return(VisitorGatePassDAL.GetList(strWhere, vwDate, flgShowAll));
 }