예제 #1
0
        public int servicedeleteDAL(string id)
        {
            int        val;
            RTOService entObj1 = new RTOService();

            try
            {
                using (IDbConnection db = GetConnection())
                {
                    SqlParameter[] paras = new SqlParameter[2];
                    paras[0] = new SqlParameter("@Service_Id", id);
                    paras[1] = new SqlParameter("@Event", "delete");

                    val = ExecuteNonQueryResult(db, "Sp_ServiceDetails", paras);
                }
            }

            catch (Exception ex)
            {
                throw new Exception("Unable to verify credentials" + ex);
            }


            return(val);
        }
예제 #2
0
        public int SuperAdminUpdateServiceDAL(RTOService servObj1)
        {
            int    NonQueryResult   = 0;
            string centreModifyTime = System.DateTime.Now.ToString();

            try
            {
                using (IDbConnection db = GetConnection())
                {
                    SqlParameter[] paras = new SqlParameter[5];
                    paras[0] = new SqlParameter("@Event", "Update");
                    paras[1] = new SqlParameter("@ServiceID_INT", servObj1.ServiceID_INT);
                    paras[2] = new SqlParameter("@ServiceName_VCR", servObj1.ServiceName_VCR);
                    paras[3] = new SqlParameter("@ServiceShortName_VCR", servObj1.ServiceShortName_VCR);
                    paras[4] = new SqlParameter("@ServiceType_VCR", servObj1.ServiceType_VCR);


                    NonQueryResult = ExecuteSPNonQuery(db, "RTO_spServiceDetails", paras);
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Unable to verify credentials" + ex);
            }
            return(NonQueryResult);
        }
예제 #3
0
        public int SuperAdminAddServiceDAL(RTOService servObj1)
        {
            int NonQueryResult = 0;

            try
            {
                using (IDbConnection db = GetConnection())
                {
                    SqlParameter[] paras = new SqlParameter[4];

                    paras[0] = new SqlParameter("@Event", "Add");
                    paras[1] = new SqlParameter("@ServiceName_VCR", servObj1.ServiceName_VCR);
                    paras[2] = new SqlParameter("@ServiceShortName_VCR", servObj1.ServiceShortName_VCR);
                    paras[3] = new SqlParameter("@ServiceType_VCR", servObj1.ServiceType_VCR);


                    NonQueryResult = ExecuteSPNonQuery(db, "RTO_spServiceDetails", paras);
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Unable to verify credentials" + ex);
            }

            if (NonQueryResult != 0)
            {
                return(1);
            }

            else
            {
                return(0);
            }
        }
예제 #4
0
        public RTOService InsertLLExamTokenDAL(string txtfromno, string txttono, string datenow, string timenow)
        {
            RTOService entObj1 = new RTOService();

            try
            {
                using (IDbConnection db = GetConnection())
                {
                    SqlParameter[] paras = new SqlParameter[5];
                    paras[0] = new SqlParameter("@from_token", txtfromno);
                    paras[1] = new SqlParameter("@to_token", txttono);
                    paras[2] = new SqlParameter("@date", datenow);
                    paras[3] = new SqlParameter("@time", timenow);
                    paras[4] = new SqlParameter("@Event", "Insert");

                    using (IDataReader reader = ExecuteSPReader(db, "RTO_spLLCallNextToken", paras))
                    {
                        while (reader.Read())
                        {
                            entObj1.llfromtoken = reader[1].ToString();
                            entObj1.lltotoken   = reader[2].ToString();
                            entObj1.lldate      = reader[3].ToString();
                            entObj1.lltime      = reader[4].ToString();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Unable to verify credentials" + ex);
            }
            return(entObj1);
        }
예제 #5
0
        public RTOService TokenLLUpdateDAL(string datenow)
        {
            RTOService entObj1 = new RTOService();

            try
            {
                using (IDbConnection db = GetConnection())
                {
                    SqlParameter[] paras = new SqlParameter[2];
                    paras[0] = new SqlParameter("@date", datenow);
                    paras[1] = new SqlParameter("@Event", "Update");

                    using (IDataReader reader = ExecuteSPReader(db, "RTO_spLLCallNextToken", paras))
                    {
                        while (reader.Read())
                        {
                            entObj1.lldate = reader[1].ToString();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Unable to verify credentials" + ex);
            }
            return(entObj1);
        }
예제 #6
0
        public RTOService TokenUpdateDAL(string services, string counterid, string staffcode)
        {
            RTOService entObj1 = new RTOService();

            try
            {
                using (IDbConnection db = GetConnection())
                {
                    SqlParameter[] paras = new SqlParameter[4];
                    paras[0] = new SqlParameter("@CurrTokenState_VCR", services);
                    paras[1] = new SqlParameter("@CurrCounterCode_VCR", counterid);
                    paras[2] = new SqlParameter("@CurrStaffCode_VCR", staffcode);
                    paras[3] = new SqlParameter("@Event", "Update");

                    using (IDataReader reader = ExecuteSPReader(db, "RTO_spCallNextToken", paras))
                    {
                        while (reader.Read())
                        {
                            entObj1.CurrServiceName_VCR = reader[1].ToString();
                            entObj1.CurrCounterCode_VCR = reader[2].ToString();
                            entObj1.CurrStaffCode_VCR   = reader[3].ToString();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Unable to verify credentials" + ex);
            }
            return(entObj1);
        }
예제 #7
0
        public int servicedeleteDAL(Int16 id, string CentreCode)
        {
            int        val;
            RTOService entObj1 = new RTOService();

            try
            {
                using (IDbConnection db = GetConnection())
                {
                    SqlParameter[] paras = new SqlParameter[3];
                    paras[0] = new SqlParameter("@ChooseServiceID_INT", id);
                    paras[1] = new SqlParameter("@CentreCode_VCR", CentreCode);
                    paras[2] = new SqlParameter("@Event", "Delete");

                    val = ExecuteSPNonQuery(db, "RTO_spAdminChooseService", paras);
                }
            }

            catch (Exception ex)
            {
                throw new Exception("Unable to verify credentials" + ex);
            }


            return(val);
        }
예제 #8
0
        public int AssignDAL(int ServiceId, int Staffid, int counterid, string centerCode)
        {
            int        val;
            RTOService entObj1 = new RTOService();

            try
            {
                using (IDbConnection db = GetConnection())
                {
                    SqlParameter[] paras = new SqlParameter[6];
                    paras[0] = new SqlParameter("@ServiceID_INT", ServiceId);
                    paras[1] = new SqlParameter("@StaffID_INT", Staffid);
                    paras[2] = new SqlParameter("@CounterID_INT", counterid);
                    paras[3] = new SqlParameter("@CentreCode_VCR", centerCode);
                    paras[4] = new SqlParameter("@AssignActiveStatus_INT", 1);
                    paras[5] = new SqlParameter("@Event", "Add");

                    val = ExecuteSPNonQuery(db, "RTO_spAssignMapping", paras);
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Unable to verify credentials" + ex);
            }
            return(val);
        }
예제 #9
0
        public int AddserviceDAL(string ServiceName, string ServiceShortName, string date, string btnval)
        {
            int        val;
            RTOService entObj1 = new RTOService();

            try
            {
                using (IDbConnection db = GetConnection())
                {
                    if (btnval == "Add Service")
                    {
                        SqlParameter[] paras = new SqlParameter[6];
                        paras[0] = new SqlParameter("@Service_Name", ServiceName);
                        paras[1] = new SqlParameter("@Service_Short_Name", ServiceShortName);
                        paras[2] = new SqlParameter("@Create_date", date);
                        paras[3] = new SqlParameter("@Modify_date", null);
                        paras[4] = new SqlParameter("@Service_Status", 1);
                        paras[5] = new SqlParameter("@Event", "Add");

                        val = ExecuteNonQueryResult(db, "Sp_ServiceDetails", paras);
                    }
                    else
                    {
                        SqlParameter[] paras = new SqlParameter[6];
                        paras[0] = new SqlParameter("@Service_Name", ServiceName);
                        paras[1] = new SqlParameter("@Service_Short_Name", ServiceShortName);
                        paras[2] = new SqlParameter("@Modify_date", date);
                        paras[3] = new SqlParameter("@Service_Status", 1);
                        paras[3] = new SqlParameter("@Service_Id", 1);
                        paras[4] = new SqlParameter("@Event", "Update");

                        val = ExecuteNonQueryResult(db, "Sp_ServiceDetails", paras);
                    }
                }
            }

            catch (Exception ex)
            {
                throw new Exception("Unable to verify credentials" + ex);
            }


            return(val);
        }
예제 #10
0
        public DataTable SuperAdminGetAllServicesDAL()
        {
            DataTable  dt1;
            RTOService servObj1 = new RTOService();

            try
            {
                using (IDbConnection db = GetConnection())
                {
                    SqlParameter para1;
                    para1 = new SqlParameter("@Event", "Select");
                    dt1   = ExecuteSPDataTable(db, "RTO_spServiceDetails", para1);
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Unable to verify credentials" + ex);
            }
            return(dt1);
        }
예제 #11
0
        public DataTable SuperAdminEditServiceDAL(string getid)
        {
            DataTable  dt1;
            RTOService servObj1 = new RTOService();

            try
            {
                using (IDbConnection db = GetConnection())
                {
                    SqlParameter[] paras = new SqlParameter[2];

                    paras[0] = new SqlParameter("@Event", "Edit");
                    paras[1] = new SqlParameter("@ServiceID_INT", getid);

                    dt1 = ExecuteSPDataTable(db, "RTO_spServiceDetails", paras);
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Unable to verify credentials" + ex);
            }
            return(dt1);
        }