Ejemplo n.º 1
0
        public Boolean updateHSNCode(serviceHSNMapping map)
        {
            Boolean status   = true;
            string  utString = "";

            try
            {
                string updateSQL = "update ServiceHSNMapping set HSNCode='" + map.HSNCode +
                                   "',Status=" + map.Status +
                                   " where RowID=" + map.RowID;
                utString = utString + updateSQL + Main.QueryDelimiter;
                utString = utString +
                           ActivityLogDB.PrepareActivityLogQquerString("update", "ServiceHSNMapping", "", updateSQL) +
                           Main.QueryDelimiter;
                if (!UpdateTable.UT(utString))
                {
                    status = false;
                }
            }
            catch (Exception)
            {
                status = false;
            }
            return(status);
        }
Ejemplo n.º 2
0
        public Boolean insertHSNCOde(serviceHSNMapping map)
        {
            Boolean status   = true;
            string  utString = "";

            try
            {
                string updateSQL = "insert into ServiceHSNMapping (ServiceItemID,HSNCode,Status,CreateTime,CreateUser)" +
                                   " values (" +
                                   "'" + map.ServiceItemID + "'," +
                                   "'" + map.HSNCode + "'," +
                                   map.Status + "," +
                                   "GETDATE()" + "," +
                                   "'" + Login.userLoggedIn + "'" + ")";
                utString = utString + updateSQL + Main.QueryDelimiter;
                utString = utString +
                           ActivityLogDB.PrepareActivityLogQquerString("insert", "ServiceHSNMapping", "", updateSQL) +
                           Main.QueryDelimiter;
                if (!UpdateTable.UT(utString))
                {
                    status = false;
                }
            }
            catch (Exception)
            {
                status = false;
            }
            return(status);
        }
Ejemplo n.º 3
0
        public Boolean validateHSNMapping(serviceHSNMapping map)
        {
            Boolean status = true;

            try
            {
                if (map.ServiceItemID.Trim().Length == 0 || map.ServiceItemID == null)
                {
                    return(false);
                }
                if (map.HSNCode.Trim().Length == 0 || map.HSNCode == null || Convert.ToInt32(map.HSNCode) == 0)
                {
                    return(false);
                }
            }
            catch (Exception)
            {
                return(false);
            }
            return(status);
        }
Ejemplo n.º 4
0
        public List <serviceHSNMapping> getServiceHSNMappingList()
        {
            serviceHSNMapping        map;
            List <serviceHSNMapping> mapList = new List <serviceHSNMapping>();
            SqlConnection            conn    = new SqlConnection(Login.connString);

            try
            {
                string query = "select a.ServiceItemID, b.Description,a.HSNCode," +
                               "a.Status,a.CreateTime,a.CreateUser,a.RowID " +
                               "from ServiceHSNMapping a left outer join " +
                               "CatalogueValue b on a.ServiceItemID = b.CatalogueValueID " +
                               " and b.CatalogueID = 'ServiceLookup' order by a.ServiceItemID";
                SqlCommand cmd = new SqlCommand(query, conn);
                conn.Open();
                SqlDataReader reader = cmd.ExecuteReader();
                while (reader.Read())
                {
                    map = new serviceHSNMapping();
                    map.ServiceItemID   = reader.GetString(0);
                    map.ServiceItemName = reader.GetString(1);
                    map.HSNCode         = reader.GetString(2);
                    map.Status          = reader.GetInt32(3);
                    map.CreateTime      = reader.GetDateTime(4);
                    map.CreateUser      = reader.GetString(5);
                    map.RowID           = reader.GetInt32(6);
                    mapList.Add(map);
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Error querying  Service HSNMApping Data");
            }
            finally
            {
                conn.Close();
            }
            return(mapList);
        }